This discussion let me think a thing that, one of my co-workers, who is good at both C and perl programming. When coding with Perl, he always like to put a 'return 0' on the end of each subroutines (maybe learn the habit from C?). So for his packages, the methods which were executed successfully will return 0. I think this behavior will make confuse for another perl caller. Is this not good prac on Perl style?
-----Original Message----- >From: Tom Phoenix <[EMAIL PROTECTED]> >Sent: Nov 1, 2007 2:21 AM >To: Jay Savage <[EMAIL PROTECTED]> >Cc: Perl List <beginners@perl.org> >Subject: Re: Getting error in Net::SFTP with get function > >On 10/31/07, Jay Savage <[EMAIL PROTECTED]> wrote: > >> it looks to me like OP is calling $sftp->get() in a void >> context: >> >> $sftp->get( $file, $localFile ) || warn("errrrr0rrrrr_---> >> $!".$sftp->status."\n"); > >It may seem that way, but the left side of the logical or operator >isn't a void context, even if the operator itself is used in a void >context. That's actually a Boolean context (which is to say a scalar >context), no matter how the operator is used. That's because the left >side must be evaluated as true or false to determine whether the right >side will be evaluated, even if the whole thing is used in a void >context. Here comes the code: > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/