in reply to Re: print() on closed filehandle WRITE_FH
in thread print() on closed filehandle WRITE_FH
Hi haukex,
I'm till getting the same error. Probably because I've added your suggestions in the wrong place.
use strict; use HTML::TreeBuilder 3; open(WRITE_FH, '>', $filename) or die "cannot open $filename"; select WRITE_FH; # ... # ... everything you print should be redirected to your file # ... my $root = HTML::TreeBuilder->new; $root->parse_file('file2.html'); my @div_class = $root->find_by_attribute("class","forminput"); foreach my $node (@div_class) { # print $node->content_list(); # print "\n"; } my $orig_fh = select(WRITE_FH); select($orig_fh); close WRITE_FH; #prnt elements in array: open( my $fh, '<', $filename ) or die "Can't open $filename: $!"; my @line = <$fh>; print "\n"; print "FillDB File Size Limit: $line[0]"; print "FillDB File Count Limit: $line[1]"; print "Timeout for queries in queue: $line[2]"; print "Size of queries in queue: $line[3]"; print "Size of results queue: $line[4]"; print "\n"; close $fh;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: print() on closed filehandle WRITE_FH
by haukex (Archbishop) on Sep 26, 2018 at 20:10 UTC | |
by TonyNY (Beadle) on Oct 01, 2018 at 12:41 UTC | |
by Your Mother (Archbishop) on Oct 01, 2018 at 13:23 UTC | |
|
Re^3: print() on closed filehandle WRITE_FH
by pryrt (Abbot) on Sep 25, 2018 at 21:14 UTC |