for my $file ( grep m#/example(\d+\.)+txt$#, glob( "$somedir/example*.txt" ) ) {