Hi Monks,
Need your expert advise to fix one urgent issue. I want to list all the files in SFTP remote server which satisfy the particular pattren like we do ls abcd*.txt.
I treid to use the bleow code but not working. Please help
use Net::SFTP::Foreign;
my $sftp = Net::SFTP::Foreign->new(
host => 'myserver.com',
port => '22',
user => 'ftpuser',
more => [qw( -i myserver.private.key.ppk)],
ssh_cmd => 'plink');
$sftp->die_on_error("Unable to establish SFTP connection");
my $entry = "abcd*.txt";
my $files = $sftp->ls ('/etc', wanted => qr/$entry/) or die "unable to
+ retrive directory: ".$sftp->error;
-- Thanks for all the replies. My problem got resolved. Thanks a lot for your help