But, personally, I prefer:for my $p9 ({grep($is_available{$_}} keys %is_available)) { ...
I find it more readable, and it should be more efficient as well, as you don't create another array.for my $p9 (keys %is_available) { next unless $is_available{$p9}; ...
In reply to Re: Foreach syntax
by pjotrik
in thread Foreach syntax
by JimSki
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |