in reply to Re: Run system command in same context of the script itself
in thread Run system command in same context of the script itself
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Run system command in same context of the script itself
by igorle (Initiate) on Apr 10, 2023 at 14:47 UTC |