in reply to Re^2: Detecting an undefined hash key
in thread Detecting an undefined hash key
It would seem that s and t are indeed strange in Getopt::Std.I disagree. There is no evidence which supports the claim that s and t are strange in any way. I tried using a and b instead of s and t in my example, and the behavior is the same. Give it a try.
I did think that, if one expected to use -t <value> on the command line then the expected syntax for getopt would be getopt('st:',\%opt); with the : indicating a required value for the argument.The getopts function (notice the "s" on the end) uses the ":" syntax, not the getopt function. So, it seems that, contrary to the docs, getopts requires you to supply a <value> with each switch.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Detecting an undefined hash key
by LesleyB (Friar) on Oct 01, 2008 at 22:13 UTC | |
by pjotrik (Friar) on Oct 01, 2008 at 23:43 UTC | |
by LesleyB (Friar) on Oct 03, 2008 at 11:46 UTC |