Public feed #893252

the parser

public text v1 · immutable
Raw Edit
·published 2008-02-06 00:15 UTC
rendered paste body
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($c_path));
    }

    push(@file,"$to_parse\\$c_path");
  }

  return @file;
}