Mallik wrote:
Can anybody explain the functionality of eval in brief?

There are two different flavors of eval().


The "string" version looks like this:

eval $code;

And it treats its argument as a string containing Perl source code,
which it compiles and executes.

The "block" version looks like this:

eval { $obj->might_die() };

And its argument is just an ordinary block (like the body of an
"if" statement).  Both forms will trap fatal errors and place the
error in [EMAIL PROTECTED]

There's a more complete explanation in "perlfunc"

% perldoc -f eval

--
Steve

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to