Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by bart (Canon)
on Sep 17, 2003 at 10:15 UTC ( #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
Node Status?
node history
Node Type: note [id://292089]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2014-10-22 06:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (114 votes), past polls