#!/usr/local/bin/perl -w use strict; use File::Find; my $dirs = '/web/directory'; find(\&search, map "$dirs/$_", qw(AA BB CC)); sub search { # ... }