my $bashcode=<<'__bash__'; . /tmp/src.sh; perl -MData::Dumper -e 'print Dumper \%ENV'; __bash__ my $VAR1; eval qx{bash -c "$bashcode"}; print $VAR1->{MONK}; #> jfroebe
Taken from Re^3: How to "source" a shell file in Perl? (Trojan Dump)
Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery
In reply to Re^2: Run system command in same context of the script itself
by LanX
in thread Run system command in same context of the script itself
by igorle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |