in reply to Perl packages to convert hash refs to array refs and vice-versa?
No module necessary, you can do
and$array_ref=[%$hash_ref];
$hash_ref = {@$array_ref};
However, you want to be careful when doing that, for example when turning a hash into an array this way the array values end up in an unpredictable order(they'll always be key,value,key,value..., but the order of the keys will be unpredictable). When going the other way, your hash keys (i.e. the first,third,fifth... array element) need to be unique or you lose data. Without knowing what it is you're trying to achieve it's hard to give advice, so perhaps you should give a bit more detail on your goal with this?
|
|---|