#!C:/perl/bin use strict; use warnings; # 761354 use HTML::Parse; use HTML::FormatText; my $contents; # global, deliberately print "\n\t File to Read: "; my $ifile=<>; chomp($ifile); # my $file = "$ifile" . ".txt" ; # Note 1 my $file="$ifile"; print "Printing name of input file:\n"; print "\t" . $ifile . "\n"; print "Done printing input file name\n\n"; readfile($ifile); sub readfile { # Note 2 local $/ = undef; open (FILE, "<$file") || die "Can't open $file: $!\n"; # select((select(FILE), $/ = undef)[0]); # Note 3 local $/ = undef; # Note 4 $contents = ; close(FILE); print "\$contents is:\n"; # Since you're doing this you could print $contents; # simply redirect output to a file... print "\n\t Done printing contents to screen\n\n"; # ...but anyway... return $contents; } # -------- Rip HTML Tags my $plain_text = HTML::FormatText->new->format(parse_html($contents)); print $plain_text; print "\n\t File to Write: "; my $writefile=<>; chomp($writefile); # $file = $file . ".txt"; # Note 5 open (DAT, ">$writefile") || die "Cannot Open File $!\n"; print DAT "$plain_text"; close($writefile);