|
|
| Think about Loose Coupling | |
| PerlMonks |
Re: Re: Parameters, subs and the shift functionby edan (Curate) |
| on Aug 19, 2003 at 10:22 UTC ( [id://284906]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
Update: This node is in response to davorg's post, which he has subsequently updated by removing the offending material, so this response as well as the response of Foggy Bottoms becomes garbage. I think in the future, davorg, you should strike out or otherwise update your node, instead of just deleting material that people have already related to. so that when you use the shift tool you don't end up with @array1 being "mary","had","a","little","lamb","!","London","Bridge","is"); and @array2 nothing... No, you're wrong. shift returns the first value in the flattened argument list each time it is called, and removes it, so @array1 will be ("mary"), and @array2 will be ("had"). If the code would have been written like this:
... then you'd be right. --3dan
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||