Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

eval expr & eval BLOCK

by perladdict (Chaplain)
on Aug 02, 2006 at 05:19 UTC ( [id://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.

Replies are listed 'Best First'.
Re: eval expr & eval BLOCK
by ikegami (Patriarch) 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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2024-03-28 23:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found