Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Later I do some post processing like:my $jobfh = FileHandle->new; $jobfh->open("myshscript 2>&1 |");
Finally, I need the correct exit code of the shell script. I always get 1 if I do:while(defined ($line = $jobfh->getline)) { # do something }
This is wrong. Can anyone please let me know how to get the correct exit code from the file handle object. Thanks and best regards, Tony$status = $jobfh->close; print $status;
Edited by Chady -- added code tags.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: exit code from FILEHANDLE object.
by haoess (Curate) on Jun 10, 2004 at 08:39 UTC |