use strict; use File::Find; my $dir = shift; my ($with, $without); print "Counting files in $dir\n"; # This is the default on Linux $File::Find::dont_use_nlink = 0; find(sub { $without++ }, $dir); $File::Find::dont_use_nlink = 1; find(sub { $with++ }, $dir); print "With \$File::Find::dont_use_nlink = 0: $without files found\n"; print "With \$File::Find::dont_use_nlink = 1: $with files found\n";