use File::Find; my $root_dir = '/files/misc/; sub find_zip { print "Found zip file $_\n" if /\.zip\z/; } find ( \&find_zip, $root_dir );