in reply to Re: Re: map() abuse or child with a chainsaw
in thread map() abuse or child with a chainsaw

Just for sheer TIMTOWTDI:
@ARGV = @ARGV[2..$#ARGV]; # or for the paran paranoid: @ARGV = (@ARGV)[(2..$#ARGV)];
... but i don't like copying the ARGV array back to itself. More readable might be:
my $discard1 = shift; my $discard2 = shift;
Out of curiosity, why would one even want to discard the first two arguments like that anyway? Seems like a bad idea in the first place.

Hmmmm ... sounds like time to pull out one of the Getopt modules to me. ;)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: 3Re: map() abuse or child with a chainsaw
by Biker (Priest) on May 13, 2002 at 20:22 UTC

    Why store the results from the two shift's in variables if the intention is to discard the values?

    shift;shift; # Should do it


    Everything went worng, just as foreseen.

Re: 3Re: map() abuse or child with a chainsaw
by kappa (Chaplain) on May 13, 2002 at 15:13 UTC
    I admire you, guys :) Correctly identifying this very needed refactoring by seeing shifting of @ARGV is long beyond my abilities :)) Yes, this utility has home-grown option processing.