... my $content; { local $/; open my $fh,'<',$file or die $!; $content = <$fh>; close $fh; } ...