in reply to test for unknown option in getopts

Just test the return value of the getopts :

use Getopt::Std; + my %opts; + getopts("ciphdvs:",\%opts) or die "$0: USAGE: blah blah\n";;

/J\

Replies are listed 'Best First'.
Re^2: test for unknown option in getopts
by GrandFather (Saint) on Aug 18, 2006 at 09:46 UTC

    The OP should note that that will result in an error line printed to stderr with text of the form: "Unknown option: b".


    DWIM is Perl's answer to Gödel
Re^2: test for unknown option in getopts
by js1 (Monk) on Aug 18, 2006 at 09:50 UTC
    Thanks - that did it!