in reply to Syntactically cool list of lists
That's not cool, that's just ugly trying to masquerade as clever.
my @a = ( [ 1, 5 ], [ 7. 9 ], [ 32, 197 ], [ 8, 4 ], [ 5 ], );
It's immediately obvious what @a contains. It's (fairly) readily maintained. Another alternative would be to store it as YAML and use YAML (or YAML::Syck) to Load it from a heredoc.
Update: Now seeing GrandFather's response I get the impression that you're asking about a general case of converting a list to an nx2 LoL and not initializing something from a static array? If that's the case, I like his reply. If you're talking about going from a static list of data, I still say go with the YAML.
|
|---|