Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Loop once on condition 1, many times on cond. 2?by punch_card_don (Curate) |
on Oct 09, 2008 at 14:54 UTC ( [id://716226]=perlquestion: print w/replies, xml ) | Need Help?? |
punch_card_don has asked for the wisdom of the Perl Monks concerning the following question:
Mondo Monks,
What is the cleanest, most simple, way to do this: If x='key_1', execute the following block of code for every key in %my_hash. But if x != 'key_1', execute that block of code for just that single key of %my_hash. For example, this would do it, but it's clunky:
Thanks
Time flies like an arrow. Fruit flies like a banana.
Back to
Seekers of Perl Wisdom
|
|