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
In reply to Re: Map list of hashrefs
by davido
in thread Map list of hashrefs
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |