-- "A. Pagaltzis" <[EMAIL PROTECTED]>
* Andrew Molyneux <[EMAIL PROTECTED]> [2002-11-20 18:25]:
A. Pagaltzis wrote:
> Enter splice.
>
> my ($max, $sep, $end) = splice @_, 0, 3;
That has brevity, certainly, but for legibility, I think I
prefer Steven's original (shift,shift,shift)
Really? I find the splice version a lot easier on the
easier on the eyes. But that's a matter of taste. How many
parameters do I have here?
shift, shift, shift, shift, shift, shift, shift, shift, shift, shift;
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
..
And this time?
splice @_, 0, 10;
Point in case, scalability.
And it obviously makes sense to use the splice at some point.
I am unlikely to use
my ( $a ) = splice @_, 0, 1;
for example. Probably after 3-4 arguments I'd give up and
use splice or at some point pass the thing as a hash[ref]
and use named parameters.
--
Steven Lembark 2930 W. Palmer
Workhorse Computing Chicago, IL 60647
+1 800 762 1582