Return value from a Perl script
perl, return-value
Solution
The best way is to wrap callee.pl in a 'sub {}' then require then script and call it. You can then treat the sub as a normal procedure.
File caller.pl
require("callee.pl");
printf("%d", callee());
File callee.pl
sub callee {
if(<Went good>)
{
return(1);
}
else
{
return(100);
}
}
1;
Problem
Is it possible to return a value (or hashes or arrays) from a Perl script invoked by another? File caller.pl ``` printf("%d", system("callee.pl")); ``` File callee.pl ``` if(<Went good>) { return(1); } else { return(100); } ```