kopolov has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use Getopt::Long; $myOpt=0; GetOptions('S=i'=> \$myOpt); print"$myOpt\n";
The file name is tst.pl
When I run this command:
./tst.pl -s 4
I get this result
4
However, when I run the same command without space between option and its value:
./tst.pl -s4
I get this error:
Unknown option: s4
I looked into Getopt::Long and saw that this form of option should be supported.
Any idea?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: GetOptions option with value and no space
by 1nickt (Canon) on Jul 12, 2015 at 12:59 UTC | |
by kopolov (Acolyte) on Jul 13, 2015 at 07:24 UTC | |
|
Re: GetOptions option with value and no space
by RichardK (Parson) on Jul 12, 2015 at 12:07 UTC | |
by u65 (Chaplain) on Jul 12, 2015 at 12:21 UTC | |
by tangent (Parson) on Jul 12, 2015 at 13:18 UTC | |
|
Re: GetOptions option with value and no space
by u65 (Chaplain) on Jul 12, 2015 at 11:28 UTC |