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

Re: accessing the result of a match as an array

by JadeNB (Chaplain)
on Dec 24, 2009 at 22:09 UTC ( #814297=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    @matches = "hello awesome" =~ /(el).*(om)/;
    print pop @awesome;
    
  2. or download this
    prototype "CORE::pop"; # => ;\@
    
  3. or download this
    print ( ( "hello awesome" =~ /(el).*(om)/ )[-1] );
    
  4. or download this
    Type of arg 1 to pop must be array (not list assignment) at -e line 1,
    + near "/(el).*(om)/)"
    
  5. or download this
    $ perl -e '( my @a = (1) ) = (2); print "@a\n";'
    2
    

Log In?
Username:
Password:

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

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





    Results (100 votes). Check out past polls.

    Notices?