Re: Getting error in Net::SFTP with get function
- From: daggerquill@xxxxxxxxx (Jay Savage)
- Date: Wed, 31 Oct 2007 13:04:08 -0400
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 about
what get() does when called in a void context.
I see a note about a non-void context, but I don't see one about a
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?
--j
--------------------------------------------------
This email and attachment(s): [ ] blogable; [ x ] ask first; [ ]
private and confidential
daggerquill [at] gmail [dot] com
http://www.tuaw.com http://www.downloadsquad.com http://www.engatiki.org
values of β will give rise to dom!
- Follow-Ups:
- Re: Getting error in Net::SFTP with get function
- From: Tom Phoenix
- Re: Getting error in Net::SFTP with get function
- From: Rob Dixon
- Re: Getting error in Net::SFTP with get function
- 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
- Getting error in Net::SFTP with get function
- Prev by Date: Re: impatient DBI query
- 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
|