foreach (readdir($dh)) { my $filesize = -s $_; print $_ . " " . $filesize . "\n"; }