Code of inter.pl is:
use strict;
use warnings;
my $var1=`cat /gra/def/ment/ckfile.txt`; #ckfile.txt doesn't exist
print "Hello World";
exit 0;
Code of ext.pl
my $rc = system ("perl inter.pl");
print "$rc is rc\n";
Here, when I run "perl ext.pl", $rc is coming as 0.
Although file inside inter.pl (/gra/def/ment/ckfile.txt) doesn’t exist, I am getting $rc as 0.
I would want $rc to be != 0 (as in one way, it should be an error as file ckfile.txt doesn't exist) in this same scenario.
Note: I can't do any modification in inter.pl
How can it be implemented?
Thanks In Advance.