in reply to slurping styles

The difference is that in the first case $/ stays undef after your code, thus affecting further operations (like chomp and reads).

Thus the second form is recommend (better even with a lexical variable as the file handle).