while ( $standir = readdir( DIR ) ) { $type = ( -d "$path\\$standir" ) ? "dir" : "file"; if ($standir =~ m/^\./) { $standir = ''; } else { $standir = "$standir" ."\n"; push(@standir,$standir); } }