I have the following code:

GetOptions(
        "n|name=s" =>   \$name,
        "a|age=i" => \$age,
        "s|sex=s" => \$sex,
) || die "Bad options\n";;

What i expected this code to do is to die if a bad option was given,
say -s without an arguement, as in ./myprog -n name -s -a 20
However, it does not do that.

What would be the correct method to die if one of the options is not complete?

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to