# type them once... my %field1; my %field2; my %HAS; # type them twice... {$HAS{$_}=1} foreach qw(field1 field2);