Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: accessing the result of a match as an array

by AnomalousMonk (Bishop)
on Dec 24, 2009 at 22:35 UTC ( #814299=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    >perl -wMstrict -le
    "print pop @{[ 'hello awesome' =~ /(el).*(om)/ ]};
    "
    om
    
  2. or download this
    >perl -wMstrict -le
    "'hello awesome' =~ /(?<m>el).*(?<m>om)/;
     print $-{m}[-1];
    "
    om
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2021-05-09 13:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (100 votes). Check out past polls.

    Notices?