in reply to Re^11: Thread on Joel on software forum : "I hate Perl programmers."
in thread Thread on Joel on software forum : "I hate Perl programmers."

Sorry, I misread the code. I suppose it could be rewritten like so:

my @grid = map [ @$_ ], ( [ '01' .. '12' ] ) x 12;

but yeah, that’s past the tipping point up to which it might make more sense than

my @grip = map [ '01' .. '12' ], 1 .. 12;

What is the difference between a list of 12 integers and a list of 12 references? Besides the memory consumed.

The difference is that the value that comes from the list is used by the map expression. With your approach, only the list length matters, while the list elements are demoted to dummy constants, so 1 .. 12 is arbitrary and could just as well be ( undef ) x 12 or split //, ' ' x 12 or whatever. It basically offends my sensibilities to have something in the code which amounts to nothing but an ornament. Not enough that I’d take the silly approach outlined in the first snippet above, though. I just try to avoid it; but the line is blurry.

Makeshifts last the longest.