sub get_function my $self = shift; my $function = shift; my @arguments = @_; my $argument; my $result; my $code = '$result = $self->' . $self->{object_methods}{$function} . '('; my $has_arguments; foreach $argument ( @arguments ) { $has_arguments = 1; $code .= "\'$argument\',"; } if( $has_arguments ) { chop $code; } $code .= ");"; print $code; eval $code; if( $@ ) { $self->{'error_type'} = "mail_merge_function error"; $self->{'error_string'} = "mail_merge_function error $@"; return( undef ); } else { return $result; } }