use strict; use warnings; use File::Find; my @result; find (sub { m/\.pl$/ and push @result, $File::Find::name; }, "aaa");