in reply to Find array duplicates

An executable example:

use strict; #create the exclusion hash outside of loop #much cheaper than recreating though each pass inside of loop! my %excluded_tables = ( 'SYSTEM' => 1, 'OBJECTS' => 1 ); my @tables = qw(PEOPLE PLACES THINGS OBJECTS CONTACTS CUSTOMERS SYSTEM +); #foreach my $table_name (@tables) would be fine, too. #assigning vars the value of $_ inside of a loop is kind of funky for (@tables) { unless (exists $excluded_tables{$_}) { print "Assigning vars for $_\n"; my ($table_1, $table_2, $table_3) = ("Table_name_A", "Table_name_B", "Table_name_C"); } else { print "Skipping $_\n"; } }
Hanlon's Razor - "Never attribute to malice that which can be adequately explained by stupidity"