It's the same variable :-)
$? The status returned by the last pipe close, backtick (``) com-
mand, successful call to wait() or waitpid(), or from the sys-
tem() operator.
For more info, man perlvar
If you care to give it a test, here it goes:
perl -e '`ls`;print $?'
# prints "0" (hopefully)
perl -e '`nonexistingcommand`;print $?'
# prints "1" (unless you have some strange command on your machine...)
HTH,
jac
On Thu, 2004-04-29 at 11:08, Durai wrote:
> Hello All,
>
> In shell script file, I can call another program & checked the exit status.
> Like:
>
> ./prog2
> if [ $? -ne 0 ]
> then
> echo "Error"
> exit
> fi
>
> How to do in perl?
>
> ANy help much appreciated.
>
> Regs,
> Durai.
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.665 / Virus Database: 428 - Release Date: 4/21/2004
--
Josà Alves de Castro <[EMAIL PROTECTED]>
Telbit - Tecnologias de InformaÃÃo
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>