You are viewing the version of this documentation from Perl blead. This is the main development branch of Perl. (git commit cf7cc0a627da2ab1c0e64ac5a77bd2ca9c1a4e52)
$EVAL_ERROR
$@

The Perl error from the last eval operator, i.e. the last exception that was caught. For eval BLOCK, this is either a runtime error message or the string or reference die was called with. The eval STRING form also catches syntax errors and other compile time exceptions.

If no error occurs, eval sets $@ to the empty string.

Warning messages are not collected in this variable. You can, however, set up a routine to process warnings by setting $SIG{__WARN__} as described in "%SIG".

Mnemonic: Where was the error "at"?