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...
With your code, that's exactly what would happen.
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:
my ($number, @array1, @array2) = @_;
... then you'd be right.
-- 3dan | [reply] [Watch: Dir/Any] [d/l] |
That's not what I understand from what 3dan said, so I'm a bit puzzled. Anyway, I updated my code and the arrays work fine now (cuz I actually had the problem but since I hadn't bothered printing out @array1 and @array2 I hadn't noticed the error, not until I felt the urge to satisfy my curiosity and ask the question here...)
Thanks | [reply] [Watch: Dir/Any] |