If it's simple arguments you want, you can do this kind of thing
my $host; my $pass; while(my $arg = shift @ARGV) { for ($arg) { if (/-h|--host/) { $host = shift @ARGV; } elsif (/-p|--pass/) { $pass = shift @ARGV; } } }
This allows you to use -h hostname OR --host hostname, and -p pass OR --pass pass. Both arguments would be stored in $host and $pass respectively
In reply to Re: CLI with ARGV
by influx
in thread CLI with ARGV
by WhiskeyJack
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |