Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have about 26 options and I would want all of the options checked if the user has entered something in the option. I am hoping to do this in a for-loop statement so that it would look cleaner. Something like this.#!/usr/bin/perl use strict; use Getopt::Long; GetOptions( 'a=s' => \my $opt_a, 'b=s' => \my $opt_b, ... 'z=s' => \my $opt_z, );
Any suggestions?for my $i (<loop through all the options>) { die if ( ! $i ); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Check to See if there is Values in Getopt::Long
by ikegami (Patriarch) on Aug 02, 2011 at 21:58 UTC | |
Re: Check to See if there is Values in Getopt::Long
by pileofrogs (Priest) on Aug 03, 2011 at 00:10 UTC |