On Thu, Jul 26, 2001 at 09:32:41PM -0700, Bob Bondi wrote:
> Question: Is there a way to capture the case of bad flags?
Getopt::Std already emits error messages when it encounters a flag it's not
configured to deal with.
You could try setting up a $SIG{__WARN__} handler. If Getopt::Std is using
warn() to report bad options your handler will intercept the warnings.
Getopt::Long is documented to work this way, i.e. setting up a __WARN__
handler will catch its warnings. It also gives you the option of not
parsing options it doesn't understand, so you could use that and go back
through the list to find anything that looks wrong.
Michael
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]