#!/usr/pin/perl
 
$file  = "perlintro.html";
$file2 = $file.'.txt';
 
open (MYIN,  "<$file")  || die "Can't open file $file:  $!";
open (MYOUT, ">$file2") || die "Can't write to file $file2: $!";
 
while ($str = <MYIN>)
{ 
  $n = index($str,'<');
  break if $n < 0;
 
  do
  {
    $m = index($str,'>',$n);
    $l = $m - $n + 1;
 
    substr($str,$n,$l) = '';
# 0123456789
#  n   m
 
    $n = index($str,'<',0);
  }
  while ($n >= 0);
 
  print MYOUT $str;  
};
 
close(MYIN);
close(MYOUT);