Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If there is a syntax error or runtime error, or a "die" statement is executed, "eval" returns an undefined value in scalar context or an empty list in list context, and $@ is set to the error message. If there was no error, $@ is guaranteed to be the empty string. Beware that using "eval" neither silences Perl from printing warnings to STDERR, nor does it stuff the text of warning messages into $@.
...
It is also Perl's exception trapping mechanism, where the die operator is used to raise exceptions.

Note that EXP30-PL. Do not use deprecated or obsolete functions or modules recommends using croak() rather than die().

...

      03. Expressions      EXP30-PL. Do not use deprecated or obsolete functionsImage Added