in reply to Re^2: Running find.exe for multiple extensions
in thread Running find.exe for multiple extensions

Any logic you can do in a shell, you can do using pure perl as well.

I don't know what $x is, but there's no reason why you can't test against a mysterious $x variable as well.

use File::Find; use strict; use warnings; my $x = shift; my @array; find(sub { push @array, $File::Find::name if /\.(?:h|c|sh)$/; }, '.'); my @x_files = grep {/\Q$x\E/} @array;