Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: global regex

by si_lence (Deacon)
on Jul 08, 2009 at 13:12 UTC ( [id://778254]=note: print w/replies, xml ) Need Help??


in reply to global regex

your code matches the first 'word' and prints it, then goes to the next line. One way of matching all words on a line is
while(<DATA>) { while ( /(\w+)/g ) { print "$1 "; } }
cheers

si_lence

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-19 22:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found