in reply to Boundary conditions with Getopt::Std

If no command line options where specified, %option will be empty. The value of 1 is set if the option is present, but the option doesn't have an argument. (At least, that's what the documentation says, some trivial testing suggests that if no argument is given, undef will be used).

As for your second question, I'd use exist to check whether an option is set, or else you might get tripped by the fact that the option is used, but the argument is false.

Abigail

  • Comment on Re: Boundary conditions with Getopt::Std