=over
=item exit EXPR
X X X
=item exit
Evaluates EXPR and exits immediately with that value. Example:
my $ans = ;
exit 0 if $ans =~ /^[Xx]/;
See also L|/die LIST>. If EXPR is omitted, exits with C
status. The only
universally recognized values for EXPR are C for success and C
for error; other values are subject to interpretation depending on the
environment in which the Perl program is running. For example, exiting
69 (EX_UNAVAILABLE) from a I incoming-mail filter will cause
the mailer to return the item undelivered, but that's not true everywhere.
Don't use L|/exit EXPR> to abort a subroutine if there's any
chance that someone might want to trap whatever error happened. Use
L|/die LIST> instead, which can be trapped by an
L|/eval EXPR>.
The L|/exit EXPR> function does not always exit immediately. It
calls any defined C routines first, but these C routines may
not themselves abort the exit. Likewise any object destructors that
need to be called are called before the real exit. C routines and
destructors can change the exit status by modifying L|perlvar/$?>.
If this is a problem, you can call
L|POSIX/C<_exit>> to avoid C and destructor
processing. See L for details.
Portability issues: L.
=back