Ah. That's the substitution operator, and it has absolutely nothing to do with how you read in the file. By the time that you call the substitution, the filehandle has already been read from. ;).
But, incedentally, if you pass a multi-line string to s/// it will go over the newlines without pause. So I guess it does kinda "treat the string as one line."
Anyhoo, for more slurping info check out the excellent tutorial at
Perl Idioms Explained - my $string = do { local $/; <FILEHANDLE> };.
Who is Kayser Söze?
Code is (almost) always untested.