Now, I'd like to only iterate over the keys with a nonzero value. In effect, I'd like to do this:for my $p9 (keys %is_available) {
But I'd like to make it as efficient as possible by putting the nonzero value constraint in the foreach line. Many thanks in advance, Jimfor my $p9 (keys %is_available) { if ($is_available{$p9}) {
In reply to Foreach syntax by JimSki
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |