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

Re^2: Seeking Getopt recommendations - anyone used Getopt::Easy?

by gaal (Parson)
on Jan 09, 2007 at 17:28 UTC ( [id://593759]=note: print w/replies, xml ) Need Help??


in reply to Re: Seeking Getopt recommendations - anyone used Getopt::Easy?
in thread Seeking Getopt recommendations - anyone used Getopt::Easy?

What's the purpose of eval { ... }; print ... if $@?

It's almost always better to let the program die if it received invalid input. You'll get the same error message (without the "ERROR: " prefix) on standard error.

Replies are listed 'Best First'.
Re^3: Seeking Getopt recommendations - anyone used Getopt::Easy?
by ides (Deacon) on Jan 10, 2007 at 14:38 UTC

    Sorry I should have been more clear. I use that standard setup and include all of the program's logic in the eval, just after the GetOptions() call. I do this in case I want to trap out the error and do something more special with it later.

    Frank Wiles <frank@revsys.com>
    www.revsys.com

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-25 17:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found