Hi,
       Thanks for the reply. Sorry for asking this one. But how to run
another perl prog?

Should I have to use system() function? Or is there any other way?

Thanks,
Durai.

----- Original Message ----- 
From: "Jose Alves de Castro" <[EMAIL PROTECTED]>
To: "Durai" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, April 29, 2004 3:30 PM
Subject: Re: Running another program in current program


> 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
>


---
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


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to