Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2018-09-20 06:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Eventually, "covfefe" will come to mean:













    Results (173 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!