in reply to evaluating field from mySQL

How about extracting the string and then accessing %ENV with it?

my $db_str = '$ENV{INP_DIR}'; $db_str =~ s/\$ENV\{([^}]*)\}/$ENV{$1}/ge; print $db_str;

Also see eval, but that will allow anybody to run arbitrary code.