my $string = $ref->{attribute}; my $output = eval $string; if($@){ die "problem with eval: $@"; } print " ----------------- $output\n";