Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Perl Programming/Keywords/eval

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Perl eq exec Keywords The eval keyword There are two uses of this keyword. The first form is the so-called "string eval" and executes the EXPRESSION as it were a Perl program. The second form, the code within the BLOCK is parsed once together with the code surrounding the eval itself, and executed within the current Perl program context. This form is typically used to trap exceptions more efficiently than the first, and also checking the code within BLOCK during compile time. Syntax eval EXPRESSION eval BLOCK Examples # This code warns on a divide-by-zero eval { $division = $divident/$divisor; }; warn $@ if $@; […] eval { die "I lived here" }; Perl eq exec Keywords