in reply to Re^3: Need alarm while getting error on SFTP
in thread Need alarm while getting error on SFTP

I am trying to get the list of remote server folder. For that I am using

 my $ls = $sftp->ls('/root/sanjay/');

But its printing all the files including .*.swp files. So I tried to filter on ".c" files & tried like this

 my $ls = $sftp->ls('/root/sanjay/*.c');

But not succeeded. How to get on ".c" files through that ???

Replies are listed 'Best First'.
Re^5: Need alarm while getting error on SFTP
by Corion (Patriarch) on Dec 03, 2015 at 11:44 UTC

    Have you read the documentation of Net::SFTP::Foreign for the ls method? It shows how to achieve what you want.

      actually, what the OP needs is the glob method.

      Ya, I read that. Its showing on some wanted & unwanted methods. I tried it too. But not succeeded.

        So why are you hiding your code from us? Maybe showing the relevant part of the code and explaining to us how you think it should work and how it works instead can help us help you better.