Example 8-2. examples/arrays/slurp.pl #!/usr/bin/perl
use strict;
use warnings;
my $file = "numbers.txt";
# slurp mode
my $all;
{
open(my $fh, '<', $file) or die "Could not open '$file'\n";
local $/ = undef;
$all = <$fh>;
}
If you are interested in on-site trainings by the author, please
contact me directly.
|