-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Updated my code to look like this:

#!/usr/bin/perl -w

use strict;

my %filenames;
my $file_count = 0;
my $processDir = "/usr/bin";

opendir DH, $processDir or die "cannot open $processDir: $!";
foreach my $file (sort(readdir DH)){
        next if ($file =~ /^.%|^..$/);
        my $mod_time = (stat($file))[9];
        $filenames{$file} = $mod_time;
}
closedir DH;

for  my $key (keys %filenames) {
        my $value = $filenames{$key};
        print "$key: $value\n";
        $file_count += 1;
}

print "There are " . $file_count . " items in the filenames array.\n";

The hash appears to be getting partially populated as my output is
giving me this:

Use of uninitialized value in concatenation (.) or string at
./fileAccess.pl line 19.
autoconf:

It doesn't seem like the stat call is working still.

Mathew

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFE5eVr7cEqtYW7kARArg1AKCQc5Qn2WxeuGyy9ipjlkIVcO4VxACcD/Wr
jKWEi0B9eEEHEfOT5FsR4Zo=
=Pqsf
-----END PGP SIGNATURE-----

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to