my $dir = 'directory name goes here'; my @files = <$dir/*>; my $count = @files;