#!/usr/bin/perl -w

$dir = shift;

opendir(my $dh, $dir) || die "Can't opendir $dir: $!";
$count = 0;
while (readdir($dh)) {
    $count++;
}
closedir $dh;


print "$count\n";
