baxy77bax has asked for the wisdom of the Perl Monks concerning the following question:
this is probably simple but i need some help with it anyway. So i have a nested loop like this:
(at some point i switched from $iiii to $j because it is easier to type)for (my $i = 1; $i<=6; $i++){ for (my $ii = 1; $ii<=6; $ii++){ for (my $iii = 1; $iii<=6; $iii++){ for (my $iiii = 1; $iiii<=6; $iiii++){ for(my $j=1;$j<=6;$j++){ for(my $jj=1;$jj<=6;$jj++){ for(my $jjj=1;$jjj<=6;$jjj++){ print "$i,$ii,$iii,$iiii,$j,$jj,$jjj\n"; } } } } } } }
so instead of writing 10 for loops i would need to do this dynamically.
baxy
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: nested loops
by BrowserUk (Patriarch) on Jan 09, 2014 at 16:33 UTC | |
|
Re: nested loops
by hdb (Monsignor) on Jan 09, 2014 at 16:27 UTC | |
|
Re: nested loops
by Anonymous Monk on Jan 09, 2014 at 16:28 UTC |