in reply to Re: How do I read an entire file into a string?
in thread How do I read an entire file into a string?
results are in $buf after the read...my $file = 'sample.txt'; my $buf; { local *FH; open FH, "$file" or die $!; -f FH and sysread FH, $buf, -s FH; }
Unless you meant to write to sample.txt in the first place, and
FH was just presumed open to some readable file...
thanks,
-Cadphile...
|
---|