in reply to key-values swapped

Maybe the best way to do it, to avoid clobberage, would be to make a hash of arrays?

So that for instance,

name => "john", age => "25", supervisor => "john", job => "programmer", location => "US"

would become

john => ['name','supervisor'], 25 => ['age'], programmer => ['job'], us => ['location']

that way, if any of your arrays had two or more elements, you'd know something had got clobbered...



($_='kkvvttuubbooppuuiiffssqqffssmmiibbddllffss')
=~y~b-v~a-z~s; print