http://www.perlmonks.org?node_id=520488


in reply to Regular Expression tricky newline problem

I have slurped this into a scalar called $contents using open and my $contents = join('', <FILE>). This all works right.
That works, of course .. just wanted to share my immediate thought of this node: Perl Idioms Explained - my $string = do { local $/; <FILEHANDLE> };