in reply to Map list of hashrefs

The first generalization is to use an array instead of variable names with numbers in them. Then you could do this:

# Preserves any pre-existing anonymous hashref. @hr = map{ $hr[$_]->{k} = $val[$_] } 0 .. $#hr;

Bah! here instead. ;)

# Preserves any pre-existing anonymous hashref. $hr[$_]->{k} = $val[$_] for 0 .. $hr;

Dave