Why doesn't getopts('absif:', \%Options) report an error when I pass an invalid option?
file.pl if (! getopts('abisf:', \%Options)) { # Display usage details print "Usage Error invalid options \n"; exit(1); } If I run: $>perl file.pl -q @argv; This should print the usage error, but it doesn't. $>perl file.pl -a @argv; This should have $Options{a}=1, but what I see is $Options{a}='', i.e., null. What's going on?
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.