http://www.perlmonks.org?node_id=484656


in reply to Getopt::Long mystery

Now, the interaction between bundling and ignore-case is documented, but NOWHERE IS IT SPECIFICALLY STATED that setting any particular configuration option (bundling, for example) disables the automatic abbreviation.
Abbreviation is not disabled with bundling. Abbreviation always applies only to 'long' (more than single character) options. Without bundling turned on, the module is looser about when it treats an option as a long option. Without bundling, -t may be a single letter option or an abbreviated long option.

With bundling turned on options beginning with a single '-' are treated as single character options exclusively. If you want to get the auto-abbreviation behavior of long names under bundling you must start the option with two '-'s. This is explicitly stated in the documentation.

--DrWhy

"If God had meant for us to think for ourselves he would have given us brains. Oh, wait..."

Replies are listed 'Best First'.
Re^2: Getopt::Long mystery
by Llew_Llaw_Gyffes (Scribe) on Aug 18, 2005 at 03:12 UTC
    With bundling turned on options beginning with a single '-' are treated as single character options exclusively. If you want to get the auto-abbreviation behavior of long names under bundling you must start the option with two '-'s. This is explicitly stated in the documentation.

    Aaaah.... That explains the behavior.  So, if one wishes to abbreviate the 'test' option to t with bundling enabled, one must somewhat counter-intuitively use '--t' instead of '-t'.  This was not clear to me from the documentation.

    I see, incidentally, that this remains true even with bundling_override set, which eliminates the double-dash requirement for long options, but evidently not for abbreviations thereof....