Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^6: What's wrong with Perl 6?

by duff (Parson)
on May 14, 2007 at 13:28 UTC ( #615303=note: print w/replies, xml ) Need Help??


in reply to Re^5: What's wrong with Perl 6?
in thread What's wrong with Perl 6?

IIRC, naming your method parameters as if they were instance variables accomplishes that trick:

method foo($.name,$.rank,$.pref) { ... } # and then later ... $obj.foo('Scott', 'Vicar', '???'); # sets the instance vars
Though pulling out the auto-magic into something you can do directly is interesting.

Check S12 in any case for the definitive answer.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2021-10-26 19:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (90 votes). Check out past polls.

    Notices?