Problems? Is your data what you think it is? | |
PerlMonks |
Re: Data structure transformationby araqnid (Beadle) |
on Apr 07, 2001 at 20:29 UTC ( [id://70725]=note: print w/replies, xml ) | Need Help?? |
I can't eliminate the need for a temporary hash: having attempted it, I'm inclined to think it's not a nice thing to do, since you always seem to end up needing to collate as a side-effect of iterating over the input...
Anyway, here's what I got:
(Subquestion: is that constuct I used in the foreach() what's called a Schwartian transform?) Update: (Subanswer: It isn't) Clearly I'm insufficiently awake. %collate can be built like this: The transform is redundant. Update II tilly suggested I point out that the code doesn't work on older Perls, even 5.005. Afaict, the changes for perl 5.005 would be:
In Section
Seekers of Perl Wisdom
|
|