Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^2: Perl oddities

by TimToady (Parson)
on Mar 01, 2005 at 21:32 UTC ( [id://435623]=note: print w/replies, xml ) Need Help??


in reply to Re: Perl oddities
in thread Perl oddities

This also is fixed in Perl 6. You can get at the captures as an array if you like, or you can even bind the variables directly within the pattern and bypass the assignment altogether (though you'd still have to declare the variables in that case). Alternately, you can name the captures within the pattern and then get at them as a hash. With some syntactic sugar, $1 is also called $<this>, $2 is also called $<that>, etc., and it's just pulling captures out of the result object without you having to declare anything (except the name bindings within the pattern).

A few other pattern matching things have changed too. :-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2024-04-19 12:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found