use strict; use warnings; use File::Find; my @directories = qw|/home /usr|; find(sub {print $_,"\n" if /\.pl$/;},@directories);