Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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

by Anonymous Monk
on Apr 07, 2015 at 15:42 UTC ( #1122712=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    while ($str =~ s/\A(foo)//) {
      push @got, $1;
    }
    die "unexpected stuff in string: $str" if $str ne '';
    
  2. or download this
    @got = $str =~ m/(foo)/g;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1122712]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2017-10-17 22:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (239 votes). Check out past polls.

    Notices?