Perl example - How do I read an entire file as a string?
Perl - How do I read an entire file as a string?
my $data;
$file = "myfile.dat";
{
local $/;
open SLURP, $file or die "can't open $file: $!";
$data = <SLURP>;
close SLURP or die "cannot close $file: $!";
}