my @array = ( \ $one, \ $two, \ $three); foreach my $item (@array){ if ($$item) { $$item = 'yes'; } else { $$item = 'no'; } }