my $dir = "bla/bla/upload";
opendir DIR,$dir;
my @dir = readdir(DIR);
close DIR;
foreach(@dir){
if (-f $dir . "/" . $_ ){
print $_," : file
";
}elsif(-d $dir . "/" . $_){
print $_," : folder
";
}else{
print $_," : other
";
}
}
opendir my $dir, "/some/path" or die "Cannot open directory: $!";
my @files = readdir $dir;
closedir $dir;
use File::Find;
my @content;
find( &wanted, '/some/path');
do_something_with( @content );
exit;
sub wanted {
push @content, $File::Find::name;
return;
}