Hi,
I am learning perl to do some test automation. In my perl scripts I need to source shell script. Can someone tell me whats wrong with the code below.
*************** *************** ***********
cat source.csh
setenv RAJAT 1
Is this the correct way to source a shell script from perl or is there any other way.
I am learning perl to do some test automation. In my perl scripts I need to source shell script. Can someone tell me whats wrong with the code below.
Code:
#!/usr/bin/perl
system "source source.csh";
$rajat = $ENV{'RAJAT'};
if (defined ($rajat)){
print "RAJAT defined\n";
}
else{
print "RAJAT not defined\n";
}
cat source.csh
setenv RAJAT 1
Is this the correct way to source a shell script from perl or is there any other way.
Comment