Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: slurping (matching \n)

by maa (Pilgrim)
on Apr 18, 2005 at 07:44 UTC ( #448750=note: print w/replies, xml ) Need Help??


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 ) { .... }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://448750]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2023-06-04 20:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you go to conferences?






    Results (22 votes). Check out past polls.

    Notices?