Is it possible to combine multiple statements into a single expression? A block could do this but I am wondering whether they could also be packaged into a expression.
That's exactly do BLOCK
's purpose.
For example,
my $file = do {
open(my $fh, '<', $qfn) or die $!;
local $/;
<$fh>
};