# need to 'slurp' in an entire file { local $/ = undef; # (read the file, etc.) } # $/ is now restored to whatever it was before