in reply to Why SFTP copy_time doesn't work?

You are trying to use Net::SFTP::Foreign::Compat put method as Net::SFTP::Foreign one, that's wrong, they have different arguments. Specifically, Net::SFTP::Foreign::Compat::put doesn't accept optional arguments as copy_time.

Replies are listed 'Best First'.
Re^2: Why SFTP copy_time doesn't work?
by sched (Initiate) on Jan 11, 2007 at 13:39 UTC

    Hi Salva,

    I used to the Foreign::Compat, but now I use the SFTP::Foreign again, just to use the "copy_time" params.

    And now I use the "status" for get the return of get,put, rename.. not using the numeric values more but the string message.

    Thank your for advicem, one more time ;o)

      As I already told you, status does return a numeric value. Use the numeric operators to handle it:
      unless ($sftp->put(...)) { if ($r == SSX_FX2_...) { # do whatever } }

      But most important, checking the status value is useless after calling put or any other high level method!!!, You should be using $sftp->error instead.