It may be worth pointing out that if you can live with putting = signs between your switches and their values:
script -f=file -s=size -t=time
instead if what you showed, you don't need to use a module or do any parsing yourself. Perl has this functionality built-in. Just add -s to your shebang under *nix or to the ftype definition under win32 and Perl will parse the values for you.
It has its limitations, but also its benefits, and its as cheap as it gets.
See perlrun for details.
In reply to Re: better cli processing
by BrowserUk
in thread better cli processing
by AlCapone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |