First, turn on warnings and behold what happens. What you're doing works, but is not proper. Change all occurrences of @_[1] to $_[1] (and so on).
Also, with constants you could name the subscripts instead. Example:
use constant OPTION_NAME => 0; sub { if( $_[OPTION_NAME] ) { .......
Dave
In reply to Re: beautifying Getopt::Long in situ subs
by davido
in thread beautifying Getopt::Long in situ subs
by perlcapt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |