It is possible simply to warn() and exit() - this will avoid additional messages for perl-5.6.0 and later:
zen% /opt/perl5.005_03/bin/perl -wle 'BEGIN { warn "foo\n"; exit 1; }'
foo
Callback called exit at -e line 1.
BEGIN failed--compilation aborted at -e line 1.
zen% /opt/perl-5.6.0/bin/perl -wle 'BEGIN { warn "foo\n"; exit 1; }'
foo
zen%
Hugo
In reply to Re: BEGIN and die(), an ugly combination
by hv
in thread BEGIN and die(), an ugly combination
by samtregar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |