Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: Getopt::Long question

by graff (Chancellor)
on Mar 03, 2009 at 03:55 UTC ( #747612=note: print w/replies, xml ) Need Help??

in reply to Getopt::Long question

When you used this ordering of args on your command line:
scriptname --dir foo --year 2007 --delay 30
did you confirm that the "$delay" variable actually got the value "30"?

I'm guessing it might not have, because there might be something else happening to @ARGV before you make the call to GetOptions() -- like maybe something pops off the last arg?

Replies are listed 'Best First'.
Re^2: Getopt::Long question
by Cody Pendant (Prior) on Mar 03, 2009 at 05:22 UTC
    You're right! I see what's gone wrong now, and I feel appropriately stupid. It wasn't actually "scriptname args" that I was running, it was "scriptalias args" where scriptalias is a doskey alias to the script, which didn't pass on all the args. Mea Culpa.

    Nobody says perl looks like line-noise any more
    kids today don't know what line-noise IS ...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://747612]
[Lady_Aleena]: shmem, I feel like an idiot for forgetting something so basic.
shmem puts a big cauldron of "silly con charme" on the table in the refectorium
[reisinge]: 'push @foo, @bar' is the same as '@foo = (@foo ,@bar)' ?
[shmem]: yes, at least for the result in @foo

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (9)
As of 2017-04-27 11:35 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (503 votes). Check out past polls.