Mathew Snyder schreef:
> #!/usr/bin/perl -w > > use strict; I would change that to: #!/usr/bin/perl -w use warnings ; use strict ; > my @filenames; > my $processDir = "/usr/bin"; > > opendir DH, $processDir or die "cannot open $processDir: $!"; > foreach my $file (sort(readdir DH)){ > push @filenames, $file; > } You sort too early. > closedir DH; Now, your $filenames can also contain names of directories. If you don't want that, see perldoc -f -f Alternative: my @filenames = grep -f, <$processDir/*> ; (but that @filenames uses more memory). > foreach my $filename (@filenames){ > next if ($filename =~ /^.$|^..$/); That regex does not do what you expect it to do: a dot matches any character. Alternatives: ^\.$ ^[.]$ ^\Q.\E$ Or use -f as I mentioned above. > my $mod_time = (stat($filename))[9]; In the readdir-variant, you need: my $mod_time = (stat "$processDir/$filename")[9]; Put a do { local $"="\n"; print "@filenames\n" } in your code, to show you what @filenames contains. > print $filename . "\n"; > print "$mod_time" . "\n"; Why did you put $mod_time inside quotes? Alternative: print "$filename\n"; print "$mod_time\n"; -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>