shan_emails has asked for the wisdom of the Perl Monks concerning the following question:
Hi All,
I used Getopt::Long module for command line Input Arguments. The perl file is executed without parameters. But i want the perl file won't execute without parameters. How can i control this case using Getopt::Long.
example
Here filename is - testcmd.pl
when i run in command prompt as below it doesn't show any error.
perl testcmd.pl
Thanks in advance,
Shanmugam A.
I used Getopt::Long module for command line Input Arguments. The perl file is executed without parameters. But i want the perl file won't execute without parameters. How can i control this case using Getopt::Long.
example
use Getopt::Long; my $data = "file1"; my $length = 4; my $verbose; GetOptions ("length=i" => \$length, "file=s" => \$data,"verbose" => + \$verbose);
Here filename is - testcmd.pl
when i run in command prompt as below it doesn't show any error.
perl testcmd.pl
Thanks in advance,
Shanmugam A.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: using "Getopt::Long" how to check parameter mandatory
by VinsWorldcom (Prior) on Aug 24, 2010 at 14:45 UTC | |
Re: using "Getopt::Long" how to check parameter mandatory
by JavaFan (Canon) on Aug 24, 2010 at 14:46 UTC | |
by DrWhy (Chaplain) on Aug 24, 2010 at 21:39 UTC | |
by JavaFan (Canon) on Aug 24, 2010 at 22:06 UTC | |
Re: using "Getopt::Long" how to check parameter mandatory
by TomDLux (Vicar) on Aug 24, 2010 at 15:23 UTC | |
Re: using "Getopt::Long" how to check parameter mandatory
by suhailck (Friar) on Aug 24, 2010 at 14:44 UTC | |
Re: using "Getopt::Long" how to check parameter mandatory
by repellent (Priest) on Aug 25, 2010 at 04:28 UTC | |
Re: using "Getopt::Long" how to check parameter mandatory
by Argel (Prior) on Aug 25, 2010 at 01:13 UTC | |
Re: using "Getopt::Long" how to check parameter mandatory
by dasgar (Priest) on Aug 24, 2010 at 18:11 UTC |
Back to
Seekers of Perl Wisdom