One way would be to set a flag in your usage() func and then bracket the code in the end block with: unless( $flag ) { ... }
Another would be to use POSIX::_exit() which will bypass END blocks (and other other cleanup including DESTROY funcs).
In reply to Re: Want END block to run except when usage()/--help invocation
by BrowserUk
in thread Want END block to run except when usage()/--help invocation
by CoVAX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |