This would allow only one mode in effect at a time, so you wouldn't need to bother with 'turning -a off'. (Of course, if you want multiple modes on it becomes much more complicated so i'll just hope theres a module)for(@ARGV) { if/^-/ $mode=$_; elsif($mode){$subTable{$mode}->($_);} else{#error or default mode} }
In reply to Re: How to parse these command-line options?
by BUU
in thread How to parse these command-line options?
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |