$hash{ do{ $_ =~ s/(..)$//; $_ } } = delete $hash{ $_ } for keys %hash; #### $hash{ substr $_, 1, 20, "" } = delete $hash{ $_ } for keys %hash;