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; }