http://qs1969.pair.com?node_id=324355


in reply to Re: Storing Lines before and After pattern
in thread Storing Lines before and After pattern

If you enjoy saving a few keystrokes here and there (and who doesn't?), you can replace

my $poem; { local $/ = undef; $poem = <DATA>; }

with this:

my $poem = do { local $/; <DATA> };

IMHO, it's not only shorter, it's also more readable, since you are assigning the entore operation to the variable. ;)