bahadur has asked for the wisdom of the Perl Monks concerning the following question:
now the problem with this code is that no matter i type -h on the command prompt or not the routine error_detect is still calledGetopt::Long::GetOptions ( 'u=s' => \$user, 'p=s' => \$passwd, 's=s' => sub { local *_ = \$_[1]; /^([^:]+):(\d+)$/ or die("Invalid format for option s.\n"); $host = $1; $port = $2;}, 'h=s' => \error_detect("h"), ) or error_detect("3 Invalid commmand line options.");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: how to make -h optional in GetOpt::Long
by tlm (Prior) on Jun 02, 2005 at 03:02 UTC | |
by ikegami (Patriarch) on Jun 02, 2005 at 04:16 UTC | |
by bahadur (Sexton) on Jun 02, 2005 at 06:14 UTC | |
by ikegami (Patriarch) on Jun 02, 2005 at 06:25 UTC |