in reply to Scanning for duplicate files

Push each file name onto an anonymous array keyed on size, then look for hash keys with multiple values. Something like:
my %files; foreach my $file_found (readdir(DIR)) { # next if $file_found =~ /^\.{1,2}\z/; my $size = (stat("$dir/$file_found"))[7]; $files{$size} ||= []; push @{ $files{$size} }, $file_found; } foreach my $same_size (values %files) { next if @$same_size == 1; print join(', ', @$same_size); }
Untested. Are you feeling lucky?