See open for details:
open my $fhFile, '<', 'theFile' or die $!; my $slurpedFile; { local $/; $slurpedFile = <$fhFile>; } close $fhFile; ## Supplying a reference to a scalar as the filename ## initiates the opening of a ram file. open my $fhRam, '<', \$slurpedFile or die $!; ## Now file operations on $fhRam will read from the slurped scalar my $firstLine = <$fhRam>; ...
In reply to Re^3: Buffered IO and un-intended slurping
by BrowserUk
in thread Buffered IO and un-intended slurping
by Wiggins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |