Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
"be consistent"
 
PerlMonks  

Re: eval inside an object

by ikegami (Patriarch)
on Apr 27, 2005 at 12:47 UTC ( [id://452023]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to eval inside an object

If I understand correct, you code is equivalent to the code below. The difference is that the code below doesn't use eval EXPR which is slow because it must compile the Perl code. The eval BLOCK used below doesn't compile anything; it just catches exceptions.

sub get_function { my $self = shift; my $function = shift; $function = $self->{object_methods}{$function}; my $result = eval { $self->$function(@_) }; if ($@) { $self->{'error_type'} = "mail_merge_function error"; $self->{'error_string'} = "mail_merge_function error $@"; } return $result; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://452023]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.