#!/usr/bin/perl -w use strict; use Cwd; use File::Find; my $filespec = '*.pl *.txt'; my $dir = $ARGV[0] || getcwd(); find( { wanted => \&find_function, preprocess => \&globber }, $dir ); sub find_function { print $File::Find::name . $/; } sub globber { ( glob "$filespec" ); }