For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > August 2007 > Re: Get names of files ONLY using module Net::SFTP::Foreign









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Get names of files ONLY using module Net::SFTP::Foreign
Chas Owens

2007-08-24, 7:01 pm

On 8/24/07, Marian Bednar <bednar@nbs.sk> wrote:
snip
> print "$_->{filename} \n" if -f $_->{filename};

snip
> Script above write out nothing, but if last line is this
>
> print "$_->{filename} \n";
>
> It writes out names of files, directories, but I need only names of files.
> How can I get it easy?

snip

either of these should work.

print "$_->{filename}\n" unless $_->{longname} =~ /^d/;
print "$_->{filename}\n" unless $_->{a}->perm() & 16384;
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com