Thanks Jeff.

How will this be considered.

if(system(CondA) && system(CondB)) ...

I am getting 0 as the $? RC...but goes to the else part of the if-statement. 
Both the conditions (Unix commands are executed). Is it taking the CondB RC?


Thanks
Manoj

if(

----- Original Message -----
From: jeff pang <[EMAIL PROTECTED]>
Date: Friday, December 14, 2007 7:09 pm
Subject: Re: Perl loop
To: [EMAIL PROTECTED], "beginners@perl.org" <beginners@perl.org>


> --- [EMAIL PROTECTED] wrote:
> 
> > 
> > Checking " if (system($touchcmd) && system($chkstat)) " as
> > condition. Is this a valid one? also was trying to get this done
> > buy calling subroutine. 
> > 
> 
> No. Generally when an unix command was executed successfully, it will
> return 0. ie,
> 
> $ perl  -le '$s = system("ls -l >/dev/null");print $s'
> 0
> 
> so,you'd better use the condition with $? variable (though it's not
> absolute),
> 
> $ perl  -le 'system("ls -l >/dev/null");if ($?==0) {print "true"}'
> true
> 
> Best Regards,
> Jeff (joy) Peng
> 
> 
>       
> ____________________________________________________________________________________
> Be a better friend, newshound, and 
> know-it-all with Yahoo! Mobile.  Try it now.  
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 
> 
> 

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


Reply via email to