in reply to How to "source" a shell file in Perl?

I've had to do something similar.

You can probably do:

my $env_from_script = `. filename; env`; my $specific_var = `. filename; echo $var_I_want`;
It's not very nice, but - I assume you've a similar situation to me - a complicated set of shell scripts, that's got all sorts of built ins configured via a 'sourceable' file. And that file is maintained, but your version won't be.