if ($uclc eq 'lc') { ... for loop with lc } elsif ($uclc eq 'uc') { ... for loop with uc } else { die "invalid arg"; }