I have never used this module. But from the documentation it looks like it is supposed to do that - just return undef and no information on failure. Which seems pretty useless.

One option is to email the author and ask about it. You may find out that he had a reason to not throw an error. For instance it may be that that call is not well supported by sftp servers, so failure isn't really viewed as an error.

Another option is to modify your copy with various debug statements and see if you can figure out where it is deciding that things didn't work. You may be able to get it to print out a transcript of the actual interaction. If you go that path then you should be able to find out why it isn't working. Of course if the problem turns out to be that the server doesn't support the command, that won't get you very far.

The third option is to find another approach for whatever you want to do.

My approach would be to file a bug about the need for better feedback from the module on why things didn't work, and then I'd proceed to find a workaround for whatever I need to do.


In reply to Re: Net::SFTP methods that return handles by tilly
in thread Net::SFTP methods that return handles by steves

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.