posix_default sets POSIXLY_CORRECT and then from Configuring Getopt::Long ...use Getopt::Long qw( :config posix_default gnu_compat bundling no_auto_abbrev no_ignore_case ); my $column = 1; GetOptions( 'column|c=i' => \$column, ) or die; ...I want this program to accept exactly two strings as options, --column and -c, but it also accepts --c. I want the prefix for short options to be - and only -, similar to how -- is treated for long options when bundling is enabled
- prefix_pattern
- A Perl pattern that identifies the strings that introduce options. Default is --|-|\+ unless environment variable POSIXLY_CORRECT has been set, in which case it is --|-.
In reply to Re: Enforce single hyphen for single character options in Getopt::Long
by parv
in thread Enforce single hyphen for single character options in Getopt::Long
by mrnoname1000
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |