my $fileContent = do { open( my $FH, '<', $filename ) or die "Error: couldn't read file '$filename': $!\n"; local $/; # slurp mode <$FH>; }; # do