in reply to can i rename hashref keys?
But you can delete pairs, and add them with a different key:
my %name_changes = ( mm => 'month', yyyy => 'year', ); for (keys %name_change){ $h->{$name_change{$_}} = $h->{$_}; delete $h->{$_}; }
You have to decide for yourself if that's worth the effort, or if you just want to rebuild the hash anew.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: can i rename hashref keys?
by dave_the_m (Monsignor) on Nov 29, 2007 at 17:09 UTC | |
by lodin (Hermit) on Nov 29, 2007 at 17:24 UTC | |
by tye (Sage) on Nov 29, 2007 at 17:42 UTC | |
by Anonymous Monk on Nov 29, 2007 at 17:36 UTC |