my $dir = 'c:/windows'; use File::Find (); File::Find::find( {wanted => \&wanted}, $dir ); sub wanted { print "$File::Find::name\n" if /\.ini\z/s; }