Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Problems? Is your data what you think it is?
 
PerlMonks  

eval expr & eval BLOCK

by perladdict (Chaplain)
on Aug 02, 2006 at 05:19 UTC ( #565160=perlquestion: print w/ replies, xml ) Need Help??
perladdict has asked for the wisdom of the Perl Monks concerning the following question:

hi monks, whats the difference between eval EXPR and eval BLOCK.which one is faster for exception handling.

Comment on eval expr & eval BLOCK
Re: eval expr & eval BLOCK
by ikegami (Pope) on Aug 02, 2006 at 05:21 UTC

    eval BLOCK is used to catch exception. It's called try in other languages. It's perfectly safe.

    eval EXPR is used to compile and execute code. While it does catch exceptions, that's not it's main purpose. It should be avoided as much as possible, and its use should raise big warning flags.

Re: eval expr & eval BLOCK
by chromatic (Archbishop) on Aug 02, 2006 at 05:58 UTC

    Exceptions aren't fast. They're exceptional.

Re: eval expr & eval BLOCK
by Mandrake (Chaplain) on Aug 02, 2006 at 06:04 UTC
    Documentation and examples are available in perldoc. Have a good coding day!!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://565160]
Approved by ikegami
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2014-04-19 18:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (483 votes), past polls