my %table; $table{type_of_animal} = "giraffe"; #### my $row = $sth->fetchrow_arrayref; $row->[0] =~ s/\$(\w+)/exists $table{$1} ? $table{$1} : "\$$1"/eg; #### { no strict 'refs'; my $row = $sth->fetchrow_arrayref; $row->[0] =~ s/\$(\w+)/$$1/eg; }
## my $row = $sth->fetchrow_arrayref; $row->[0] =~ s/\$(\w+)/exists $table{$1} ? $table{$1} : "\$$1"/eg; ##
## { no strict 'refs'; my $row = $sth->fetchrow_arrayref; $row->[0] =~ s/\$(\w+)/$$1/eg; }