Why do you want to create arrays with just one value? The following code will do it...
my %hashofarrays=map{ my($key,$value)=split/[:]{2}=/; ($key=>[$value]) }<STDIN>;
However, I really question whether that's actually what you want. With only one value in the array, I don't see much sense in having the array. Wouldn't it be easier just to store the value directly in the hash? Or did you want to further split the value in some way, or push it onto the array so as to preserve possible previous values (update: as pg's answer guesses), or some other thing you aren't telling us about that would impact our answer? Knowing only what you've told us, the above code does what you asked, but I'm not confident it's right.
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/
In reply to Re: Hash of Arrays
by jonadab
in thread Hash of Arrays
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |