- or download this
my $content = do {
open my $fh, '<', $file or die "Couldn't open $file: $!\n";
local $/ = undef;
<$fh>;
};
- or download this
my $content;
{
...
local $/ = undef;
$content = <$fh>;
}
- or download this
my $content = sub {
my $file = shift;
...
local $/ = undef;
return <$fh>;
}->($file);
- or download this
ok 1;
...
}
ok 3;