I am invoking a perl program from the shell script. the shell script is named as sam.sh
#!/usr/bin/sh
perl check1.pl cr_incr08292005 n n //cr_incr08292005 is the directory under a directory where sam.sh,slp.pl and check1.pl are stored.
The check1.pl is as below. The check1.pl inturn call another perl program slp.pl.
#!/usr/local/bin/perl
$runAutomatic=$ARGV[1];
$skipCaseClean=$ARGV[2];
if( -d $ARGV[0])
{
print("Directory is $ARGV[0]");
}
if ($runAutomatic eq "n"){ print "No run automatic";
}
if ($skipCaseClean eq "n") { print "No skipping bad cases";
$i=1;
}
print "calling";
system "perl slp.pl" || die "Cannot open"
But when i run the main program using the command
sh sam.sh
The output is as below.
This is from slp.pl
Directory is cr_incr08292005
No run automatic
No skipping bad cases
calling
So the problem is when ever the external perl program is invoked "the system command is called first and then rest of the statements in th program is executed". Please provide me the solution for this problem.