Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

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.

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://565160]
Approved by ikegami
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2018-06-19 20:33 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (114 votes). Check out past polls.