On 13 August 2014 11:11, Adrian Lai <perl at loathe.me.uk> wrote: > You possibly want: > > map { $ref->{ $_->[0] }->{position} => $count++; $ref->{$_->[0]} } Bad copy/paste/editing, I meant: map { $ref->{ $_->[0] }->{position} = $count++; $ref->{$_->[0]} } Adrian.