foreach $key ( ($x eq 'key_1') ? keys %my_hash : $x ) { do a bunch of stuff }
UPDATE: Had to reverse the logic of the ?:, thought you wanted it the other way round
In reply to Re: Loop once on condition 1, many times on cond. 2?
by jethro
in thread Loop once on condition 1, many times on cond. 2?
by punch_card_don
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |