in reply to Re^3: problem with Getopt::Long
in thread problem with Getopt::Long

Another thing to note is that a double dash will stop option processing, so if I enter
perl try.pl --i -- h --o=foo
to the script the (valid) o option won't be parsed either and will remain in ARGV.

The only reason I bring it up now is that I find it amusing that in a nitpicky post, I didn't specify all cases.

Replies are listed 'Best First'.
Re^5: problem with Getopt::Long
by Aristotle (Chancellor) on Aug 20, 2004 at 11:22 UTC

    Actually, the double-dash actually tells Getopt::Long to consider anything following an argument, regardless of whether it looks like an option or not. (The parser simply stops looking at all.) So your original assertion that options are removed but arguments are left can be considered correct, and IMHO is more correct than your nitpick, though it is of course incomplete without mentioning the function of the double-dash.

    Sure, I am arguing semantics, but I wasn't the one who started nitpicking, now was I? ;-)

    Makeshifts last the longest.

      That's what I meant when I said "stops option processing." I just didn't say it as well. ^_^
Re^5: problem with Getopt::Long
by Random_Walk (Prior) on Aug 20, 2004 at 10:30 UTC
    Nkuvu++ for self nitpicking