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