in reply to substitute of dotsh.pm

I've never used it and I am not sure where it came from (read untested) but I found this in my code archive, it might be useful as a starting point if for some reason you can't use the YAML solution.
sub source_shell_profile { # source a shell profile and extract ENV vars my($profile) = $_[0]; local(*STDIN,*STDERR); # could just close STDIN instead, but some programs # don't deal with that very well... open(STDIN,"/dev/null"); open(STDERR,">/dev/null"); my %env = map {chomp;split(/=/,$_,2)} `. $profile; env`; return %env; }

--
Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho