Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 exploiting the Monastery: (13)
As of 2014-10-21 09:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (99 votes), past polls