my @file_list; sub files_wanted { my $text = $File::Find::name; if ( -f ) { push @file_list, $text; } } #If you set a base directory above, you will need to change $directory to $base_directory.$directory. find(\&files_wanted,$directory); #This section creates a hash of arrays of files, with the hash keys being filename.ext and the file +size in #parentheses. The raw file name is the entire path including the file name. my %files; for my $raw_file (@file_list) { my @file_parts = split(/\//,$raw_file); my $file = pop @file_parts; my $file_size = -s $raw_file; push @{$files{"$file ($file_size bytes)"}}, $raw_file; }