Perl eval Function



Description

This function evaluates EXPR at execution time as if EXPR were a separate Perl script. This allows you to use a separate, perhaps user-supplied, piece of Perl script within your program. An eval EXPR statement is evaluated separately each time the function is called.

The second form evaluates BLOCK when the rest of the script is parsed (before execution).

Syntax

Following is the simple syntax for this function −

eval EXPR

eval BLOCK

Return Value

This function returns value of last evaluated statement in EXPR or BLOCK

perl_function_references.htm
Advertisements