Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re (tilly) 1: Using perl's runtime options with -Mstrict

by tilly (Archbishop)
on Jan 27, 2001 at 04:27 UTC ( #54681=note: print w/replies, xml ) Need Help??

in reply to Using perl's runtime options with -Mstrict

Expanding on what tye said, you are wandering in very dangerous territory with your construct. First of all your construct is wandering into the my $foo if 0 bug. Secondly if your user mistypes the command line ever so slightly then neither you nor they get a chance to catch that fact. Thirdly you do not have any chance to choose to have certain options take arguments.

I generally rectify all of these with Getopt::Std. If you want longer option names, you can use Getopt::Long instead. (It has a significantly more complex interface though.) Both are part of the standard distribution..

  • Comment on Re (tilly) 1: Using perl's runtime options with -Mstrict

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (1)
As of 2021-10-19 05:01 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (76 votes). Check out past polls.