in reply to Any Elegant Way to iterate through this hash?
my @sorted_keys = qw(Left Center Right); for (@sorted_keys) { my $k = $_; my $v = $top_align{$k}; if ($image_align_top eq $v) { print qq|<td> <div align="center"> $k <input type="radio" name="image_align_top" +value="$v" checked> </div> </td>|; } else { print qq|<td> <div align="center"> $k <input type="radio" name="image_align_top" +value="$v"> </div> </td>|; } }
And forget the loop altogether...
cLive ;-)
ps - looking at it again, why not do something like this instead:
my $v = lc($image_align_top); if ($v =~ /^left|center|right$/) { ...
--
seek(JOB,$$LA,0);
|
|---|