Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Perl oddities

by TimToady (Parson)
on Mar 01, 2005 at 21:32 UTC ( #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
Node Status?
node history
Node Type: note [id://435623]
help
Chatterbox?
[LanX]: so it was the will of the people to take back control
[LanX]: ;)
[marto]: and you still can't get a decent cup of tea in that town
[davies]: The turnout, IIRC, was about 12%.
[&lt; &amp; &gt;]: 12% seriously? =)

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (10)
As of 2017-12-15 19:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (442 votes). Check out past polls.

    Notices?