in reply to Re: Perl SFTP do_mkdir not able to create directory
in thread Perl SFTP do_mkdir not able to create directory

Hi salva,

Thanks for your response. But I am trying to send the file to different hosts. So I wont be able to use the same SSH to do the task I presume.

  • Comment on Re^2: Perl SFTP do_mkdir not able to create directory

Replies are listed 'Best First'.
Re^3: Perl SFTP do_mkdir not able to create directory
by salva (Canon) on Apr 09, 2013 at 07:55 UTC
    In that case, you can use Net::OpenSSH::Parallel:
    use Net::OpenSSH::Parallel; my $pssh = Net::OpenSSH::Parallel->new; $pssh->add_host($_) for @hosts; sub sftp_task { my ($host, $ssh) = @_; my $sftp = $ssh->sftp; $sftp->mkdir("ftp2SAT5") or die "unable to create directory: " . $sftp->error; } $pssh->all(parsub => &sftp_task); $pssh->run;
      Fixed the issue by using fork as suggested by salva.

      Thank you PerlMonks