On 13 August 2014 10:33, Dermot <paikkos at gmail.com> wrote: > # map { $ref->{ $_->[0] }->{position} => $count++ } You probably want = $count++, rather than =>. You possibly want: map { $ref->{ $_->[0] }->{position} => $count++; $ref->{$_->[0]} } Adrian.