in reply to How can I have both short and long options with Getopt::Long?
This works for me:
$ cat 3perl.pl use strict; use warnings; use 5.010; use Getopt::Long; Getopt::Long::Configure(qw{no_auto_abbrev no_ignore_case_always}); my $verbose = ""; GetOptions ('verbose|v' => \$verbose); say $verbose;
$ perl 3perl.pl -v 1 $ perl 3perl.pl -V Unknown option: V $ perl 3perl.pl -verbose 1 $ perl 3perl.pl -Verbose Unknown option: Verbose $ perl 3perl.pl -ver Unknown option: ver
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How can I have both short and long options with Getopt::Long?
by almut (Canon) on Nov 12, 2009 at 13:24 UTC | |
|
Re^2: How can I have both short and long options with Getopt::Long?
by 7stud (Deacon) on Nov 12, 2009 at 13:03 UTC |