FWIW, coming in such a long time after the party:
It has become my “standard conversion” for where I want to type
Of course, in this particular case, the correct, optimal solution is trivial:
my @grid = ( '01' .. '12' ) x 12;
In the more general case, I prefer another way, because it maintains symmetry:
my @grid = map @$_, ( [ '01' .. '12' ] ) x 12;
And to this:
Beyond the thinko, the problem I have with the for/push method is that the main objective – that of initialising the array @grid – gets lost in the noise of the construction.
I say bingo. That’s the reason I use Perl to begin with, rather than C. (“If I had a nickel for every time I wrote for( i = 0; i < LEN ; ++i ), …”)
Makeshifts last the longest.
In reply to Re^10: Thread on Joel on software forum : "I hate Perl programmers."
by Aristotle
in thread Thread on Joel on software forum : "I hate Perl programmers."
by techcode
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |