in my little perl script (test.pl) I do the following in order to exit from program if
EXIT_STATUS equal to 1
if ( $EXIT_STATUS == 1 )
{
system (exit);
}
but I need also to get from the test.pl return code 1
for example
./test.pl
echo $?
how to enable return code 1 if EXIT_STATUS = 1 ?
lidia
That’s not how you should exit in perl. It’s:
and if you want to exit normally otherwise:
or (depending on your intention) more simply:
see: http://perldoc.perl.org/functions/exit.html