The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
broquaint's recent reply to a discussion on programming style, has set me thinking.
So, if you want modifiable scalar parameters, you can change them inside a sub by using $_[0], $_[1] etc. as lvalues without resorting to references. Interesting. Also, I am reminded of how $_ gets bound to successive members of an array: Is the same true if you use an intermediate variable - does it get aliased, or merely assigned? Apologies: I don't have access to a machine running Perl at the moment Also I'm wondering about the future of all this. What of behaviour in Perl 6? Coming back to the first scenario, I hear that Perl 6 will be getting some Ruby features. Does this include passing parameters by name and hence Jensen's device? --rW Note: magicality - this might be a new term I am coining. Magicality bears as much relation to magic as sexuality does to sex. In reply to Thoughts on the magicality of @_ and $_ by rinceWind
|
|