in reply to Only files starting with xxxx

my @allfiles = readdir THEDIR; closedir THEDIR; my @filtered_files = grep /^xxxxx/, @allfiles; foreach my $file...

Originally posted as a Categorized Answer.