Can someone please steer me straight with respect to my simple-minded test? I am running this program on Win 2K, and attempting to retrieve HTML, remove the tags (which I think is now working OK), and then write the scalar direct to a file 'open'ed for OUTPUT. Here is the code:
#!/usr/bin/perl
use warnings;
use strict;
use LWP::Simple;
my $site="my $content=get $site;
my $message=$content;
$message=~s/<.+?>/ /g;
open OUTPUT, ">C:\test\file01.txt";
print OUTPUT $message;
close OUTPUT;
I am getting the "print() on closed filehandle" message shown above. The explanation is that "The filehandle you're printing on got itself closed sometime before now. Check your control flow." I'm just a newbie doing some healthy testing and I don't see where I closed the actual filehandle OUTPUT.
Any suggestions would be greatly appreciated.
Thank you
#!/usr/bin/perl
use warnings;
use strict;
use LWP::Simple;
my $site="my $content=get $site;
my $message=$content;
$message=~s/<.+?>/ /g;
open OUTPUT, ">C:\test\file01.txt";
print OUTPUT $message;
close OUTPUT;
I am getting the "print() on closed filehandle" message shown above. The explanation is that "The filehandle you're printing on got itself closed sometime before now. Check your control flow." I'm just a newbie doing some healthy testing and I don't see where I closed the actual filehandle OUTPUT.
Any suggestions would be greatly appreciated.
Thank you