in reply to Re^4: my array is almost a hash, but keys are not unique.
in thread my array is almost a hash, but keys are not unique.
Which was basically ELISHIVAS, with dereferencing and no postfix while.my %out; my @in = @{ $in }; my $i = 0; while ( $i < $#in ) { push( @{ $out{ $in[ $i++ ] } }, $in[ $i++ ] ) ; } return \%out;
|
|---|