in reply to source a file in Linux using perl script

Maybe take a "Trojan Dump" ;-)

my $bashcode=<<'__bash__'; source ~/.bash_profile; perl -MData::Dumper -e 'print Dumper \%ENV'; __bash__ my $VAR1; eval qx{bash -c "$bashcode"}; my $dir = $VAR1->{CTC_HOME};

explanation here:

Re^3: How to "source" a shell file in Perl?

HTH! :)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery