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; }
In reply to Re: eval inside an object
by ikegami
in thread eval inside an object
by Angel
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |