You don't even need to change the directory. Give this a shot -- it stores the contents of a directory and removes non-files
my $dir = '/genomes/Bacteria'; # use single quotes where possible, e.g., no var or \n # it's a tiny bit faster ## get the contents of a directory my @dir_listing = <$dir/*>; ## note: using <$dir/*/> would find all the directories ## removes . and .. while ($dir_listing[0] =~ /^\.+$/) { shift @{$dir_listing}; } ## removes all directories my @files_found = map { (-d $_) ? () : $_ } @dir_listing;
In reply to Re: New to Perl: Finding files on FTP
by muppetjones
in thread New to Perl: Finding files on FTP
by Klaas
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |