Re: Getting error in Net::SFTP with get function
- From: rob.dixon@xxxxxxx (Rob Dixon)
- Date: Wed, 31 Oct 2007 17:46:30 +0000
Jay Savage wrote:
On 10/31/07, Tom Phoenix <tom@xxxxxxxxxxxxxx> wrote:On 10/31/07, Jay Savage <daggerquill@xxxxxxxxx> wrote:
Take another look at the Net::SFTP docs, particularly the note aboutI see a note about a non-void context, but I don't see one about a
what get() does when called in a void context.
void context. The OP didn't use the get() method in a void context.
Did you mean to write "non-void"?
http://search.cpan.org/~dbrobins/Net-SFTP-0.10/lib/Net/SFTP.pm
As I interpret the docs, the OP's code should be correct. But maybe
I'm missing something.
I suppose I should have said non-void, because that is the behavior
the doc actually describes.
The assumption, though, is that void context will yeild the opposite
result. And it looks to me like OP is calling $sftp->get() in a void
context:
$sftp->get( $file, $localFile ) || warn("errrrr0rrrrr_--->
$!".$sftp->status."\n");
At least I'm not aware that that '||' forces any particular context on
the lefthand operand. Perlop mentions propagating context WRT the
righthand operand, but doesn't say anything about the left. So I would
expect get() to return the same in the following cases:
$sftp->get( $file, $localFile);
$sftp->get( $file, $localFile), print "something";
$sftp->get( $file, $localFile ) || die();
Given that, I would expect, from the docs, for get() to return the
empty string on success and undef on failure, both of which are
equally false from the perspective of '||'.
Or maybe *I'm* missing something?
perl -e "@x=(1,2,3); print @x || 99;"
Rob
.
- References:
- Getting error in Net::SFTP with get function
- From: Kilaru Rajeev
- Re: Getting error in Net::SFTP with get function
- From: Jay Savage
- Re: Getting error in Net::SFTP with get function
- From: Tom Phoenix
- Re: Getting error in Net::SFTP with get function
- From: Jay Savage
- Getting error in Net::SFTP with get function
- Prev by Date: Re: Getting error in Net::SFTP with get function
- Next by Date: Re: Getting error in Net::SFTP with get function
- Previous by thread: Re: Getting error in Net::SFTP with get function
- Next by thread: Re: Getting error in Net::SFTP with get function
- Index(es):
Relevant Pages
|