Recently someone derided my for implementing the algorithm this way (but didn't suggest a better way of doing it). Does an obviously (to the cognoscenti) better approach exist?#!/usr/bin/perl -w use strict; for my $i ( 0 .. 9 ) { for my $j ( 0 .. 9 ) { for my $k ( 0 .. 9 ) { for my $l ( 0 .. 9 ) { # do something with $i$j$k$l } } } }
In reply to looping efficiency by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |