http://www.perlmonks.org?node_id=941754


in reply to Can't Write to Files properly

$HTML1 and $HTML2 are created and defined in the MakeHTML subroutine. Once that subroutine ends they're out of scope. ExtractText then prints variables with the same name that are undefined.

See Scoping for more info.

If all you're interested in is a quick bandage (over an arterial laceration...), add

my $HTML1; my $HTML2;
after my $point;. Then get some sleep, uncomment use strict;, and start on a real fix.