my $spec = ‘*_{process,read}_*’; my $reg = $spec; $reg =~ s/\*/(.*?)/g; my @use; for my $file ( glob $spec ) { $file = m/$reg/; push @use, $file unless $1 =~ /\+/; }