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 ) { .... }
In Section
Seekers of Perl Wisdom