See
Hash::Rename
Renaming hash's keys in place
#!/usr/bin/perl -w use strict; use Hash::Rename; my %h = ( '.111' => 'Aaaa', '.222' => 'Bbbb', '.333' => 'Cccc' ); hash_rename %h, code => sub { s/.{2}// }; __END__ Output: $VAR1 = { '22' => 'Bbbb', '11' => 'Aaaa', '33' => 'Cccc' };
hth,
PooLpi
In reply to Re: Using substr on Hash Keys
by poolpi
in thread Using substr on Hash Keys
by pc0019
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |