Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I currently have a data structure where I have a bunch
of (roughly) key/value pairs. However, they are NOT hashable,
both because keys are not unique, and because order is important.
Currently, I have lots of accessor functions where I do stuff like this to extract the values, but not the keys. Any suggestions on a better idiom? I really don't dig having to make a copy of the list to jump thru it. I've thought about hitting the 2nd, 4th, 6th, etc elements, but that seems to non-Perl-like. Suggestions welcomed...
Thanks, %_=split/;/,".;;n;u;e;ot;t;her;c; ". # Andy Lester 'Perl ;@; a;a;j;m;er;y;t;p;n;d;s;o;'. # http://petdance.com "hack";print map delete$_{$_},split//,q< andy@petdance.com > In reply to Idiom for looping thru key/value pairs by petdance
|
|