sub parse_path { my $to_parse = shift; opendir(HERE,$to_parse) or die; my @path = readdir(HERE); closedir(HERE) or warn; my @file; foreach my $c_path (@path) { # skip that crap next if $c_path =~ /^\.{1,2}$/o; # check if we're to parse a directory if (-d $c_path) { push(@path,parse_path("$to_parse\\$c_path")); } push(@file,"$to_parse\\$c_path"); } return @file; }