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