Lexical scope 

my $text = do {
    use autodie;
    open my $fh, '<', $filename;
    local($/) = undef;
    <$fh>;
};