bichonfrise74 has asked for the wisdom of the Perl Monks concerning the following question:
See below what happens when I run the code above.#!/usr/bin/perl use warnings; use strict; use Getopt::Long; my ($option_test); GetOptions( "test=s" => \$option_test ); print 'option is not defined.' if ( ! $option_test );
So, the 2 tests above shows that if I do not supply a proper argument to the -t option, then it is as if I did not use the -t option at all.$ test.pl option is not defined. $ test.pl -t Option test requires an argument option is not defined.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Requiring option values in Getopt::Long
by markkawika (Monk) on Aug 20, 2009 at 00:04 UTC | |
|
Re: Requiring option values in Getopt::Long
by toolic (Bishop) on Aug 20, 2009 at 00:28 UTC | |
|
Re: Requiring option values in Getopt::Long
by JavaFan (Canon) on Aug 20, 2009 at 00:06 UTC | |
|
Re: Requiring option values in Getopt::Long
by bichonfrise74 (Vicar) on Aug 20, 2009 at 02:54 UTC | |
by ikegami (Patriarch) on Aug 20, 2009 at 03:27 UTC | |
by zwon (Abbot) on Aug 20, 2009 at 18:31 UTC | |
|
Re: Requiring option values in Getopt::Long
by bichonfrise74 (Vicar) on Aug 20, 2009 at 16:54 UTC | |
by Anonymous Monk on Oct 08, 2010 at 21:46 UTC |