use Crunch; %process = ( 'WalMart' => 'A:A:A', 'ExxonMobil' => 'B:D:A', ... 'CiscoSystemsInc' => 'C:D:A', ); sub do_em { my $path_to_companies = shift; opendir $dh, $path_to_companies or die "Can't opendir $path_to_companies: $!\n"; while ( my $company = readdir( $dh ) ) { next if $company ~= /^\./; my $dir = catdir( $path_to_companies, $company ); next unless -d $dir; Crunch::do_it( dir => $dir company => $company process => $process{$company); ); } }