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


in reply to slurping (matching \n)

Bear in mind that you might get bitten in longer programs if you don't actually localise your local lexically.

{ local $/ = undef; my $names = <DATA>; } #$/ is back to our original record separator #(which you can use in the regexp if you want) e.g. if ( $names =~ m|First: (\w+)$/Second: (\w+)$/Third: (\w+)|s ) { .... }