in reply to Re^2: Escaping special characters in filename for Net::SCP
in thread Escaping special characters in filename for Net::SCP

What a gross mess, blazar. Anything other than something like the following is not worth your time:
use File::Copy; $basedir='/path/to/files'; $foo = $_; $foo =~ s#/#slash#g; $foo =~ s#->#arrow#g; $fubar = "$basedir/$_"; copy($fubar, "$basedir/$foo"); $scp->put("$basedir/$foo"); system('rm', "$basedir/$foo") && die "Can't remove $foo:$!\n";
with appropriate my's and stricts as appropriate.

Replies are listed 'Best First'.
Re^4: Escaping special characters in filename for Net::SCP
by blazar (Canon) on Mar 29, 2005 at 17:42 UTC
    I must say that in the meantime I've happily switched to Net::SFTP, so no more problems on the practical side of things. Still slightly curious if it would have been possible to do it with Net::SCP and if so, how. Net::SFTP seems a superior solution in any case...
      sftp is better than scp, so I'm not surprised that Net::SFTP is better. I don't know if scp is being kept up with all of the latest OpenSSH ports, either. Don't use it myself. :)

      In any event, glad you're past it! :D