Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Perl Idioms Explained - @ary = $str =~ m/(stuff)/g

by bart (Canon)
on Sep 17, 2003 at 10:15 UTC ( [id://292089]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $num_matches_stuff = $str =~ m/(stuff)/g;
    @all_the_matches   = $str =~ m/(stuff)/g;
    
  2. or download this
    $str = "stuff stuff stuff";
    $num_matches_stuff = $str =~ m/(stuff)/g;
    print $num_matches_stuff;
    
  3. or download this
    $str = "stuff stuff stuff";
    while($str =~ m/(stuff)/g) {
        print "Got one!\n";
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-16 12:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found