in reply to How to get two array in subroutine
You could add a parameter that gives the length of the first array like this:
&d(scalar(@a),@a, @b); sub d{ my ($len,@c)= @_; my @d= splice(@c,$len); ...
But you really need a good reason to do that, this is 2/3 of a bad hack. Use references (and strict and warnings, by the way)
UPDATE: Typo in the script corrected. Thanks go to CountZero for finding it
|
|---|