Next | Program Repair Shop | 13 |
Analogously, we can replace this:
for (@$items) { if ($index == 0) { action0 } elsif ($index == 1) { action1 } elsif ($index == 2) { action2 ... } elsif ($index == 16) { action16 } $index++; }
With this:
action0 action1 action2 ... action16
Next | Copyright © 2006 M. J. Dominus |