TonyNY has asked for the wisdom of the Perl Monks concerning the following question:
Hi
Is it possible to make a 3rd command line argument optional and then execute a command if certain condition is met?
my $pkgname = $ARGV[0]; my $envname = $ARGV[1]; chomp; s/^\s+|\s+$//g; # trim spaces ##optional 3rd command line argument my $id = $ARGV[2]; chomp $id; if (not defined $id) { ($bquery eq $bfquery1) } else { ($bquery eq $bfquery2) }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Make command line argument optional
by Athanasius (Archbishop) on Jul 10, 2018 at 02:46 UTC | |
by TonyNY (Beadle) on Jul 10, 2018 at 20:20 UTC | |
by huck (Prior) on Jul 10, 2018 at 21:37 UTC | |
|
Re: Make command line argument optional
by AnomalousMonk (Archbishop) on Jul 10, 2018 at 02:36 UTC | |
|
Re: Make command line argument optional
by AnomalousMonk (Archbishop) on Jul 10, 2018 at 03:03 UTC | |
|
Re: Make command line argument optional
by Anonymous Monk on Jul 10, 2018 at 15:15 UTC | |
by Anonymous Monk on Jul 11, 2018 at 14:05 UTC |