in reply to split an array in two
Explicitly returning empty array references is unnecessary, since an empty argument list will give you that anyway.sub split_array_in_two { my @x = @_; my @second = splice @x, @x/2; \@x, \@second; }
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: split an array in two
by Roy Johnson (Monsignor) on Apr 28, 2005 at 15:09 UTC |