#!/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>)
{ 
  $str =~ s/<[^>]+>//g; 
  print MYOUT $str;  
};
 
close(MYIN);
close(MYOUT);