Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

(jeffa) 3Re: map() abuse or child with a chainsaw

by jeffa (Bishop)
on May 13, 2002 at 14:39 UTC ( [id://166191]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://166191]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-16 06:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found