in reply to passing multipule -v to a script
from perldoc Getopt::Long
An incremental option is specified with a plus "+" after the option name: my $verbose = ''; # option variable with default value (false) GetOptions ('verbose+' => \$verbose); Using "--verbose" on the command line will increment the value of "$verbose". This way the program can keep track of how many times the option occurred on the command line. For example, each occurrence of "--verbose" could increase the verbosity level of the program.
mkmcconn
|
---|
Replies are listed 'Best First'. | |
---|---|
Passing multiple flags and incrementing
by Ferret (Scribe) on Jul 29, 2002 at 23:28 UTC |
In Section
Seekers of Perl Wisdom