in reply to Short example using IPC::Open2 or IPC::Open3

If it were up to me, I'd skip IPC::Open\d and just do something like:
chomp (my @files = `ssh somehost ls foo`); for (@files) { my $qf = quotemeta; system "scp somehost:foo/$qf ."; system "ssh somehost mv foo/$qf bar/$qf"; }
(Update: see below for a solution pertinent to L~R's actual needs)

Replies are listed 'Best First'.
Re^2: Short example using IPC::Open2 or IPC::Open3
by Limbic~Region (Chancellor) on Oct 23, 2007 at 20:22 UTC
    gamache,
    You assume that one can SSH to the host. In this case, shell access has been removed. Please don't take this the wrong way but I wouldn't have asked for an example of IPC::Open2 (even if it was the wrong way to do it) if that wasn't what I was interested in.

    Cheers - L~R

      No offense taken, but I don't understand how IPC::OpenX is going to help you, if you can't ssh to the machine.
        gamache,
        It is possible to set up a machine to allow sftp without ssh. For instance, just set the login shell to /sbin/false. I have sftp access but not ssh.

        Cheers - L~R

        Removed analogy to ftp and telnet as it wasn't an accurate comparison.