Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: ARGV issue

by ikegami (Pope)
on Oct 02, 2011 at 21:57 UTC ( #929188=note: print w/ replies, xml ) Need Help??


in reply to ARGV issue

You have a couple mistakes.

  • my($#ARGV) = @_; makes no sense.

  • $arg contains a number, so it'll never be equal to any of the strings to which you compare it. You would need to loop over @ARGV.

I'd use Getopt::Long.

use Getopt::Long qw( GetOptions ); sub usage { print STDERR "...simple usage...\n"; exit(1); } sub help { print "...more extensive help...\n"; exit(0); } GetOptions( 'h|?|help' => \&help, ... ) or usage();

You might also find Pod::Usage of interest.


Comment on Re: ARGV issue
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2015-07-31 03:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls