perl hash 切片
#!/usr/bin/perl -w
use strict;
use YAML::XS;
my %hash;
my %new;
@hash{'a' .. 'm'} = 1 .. 13;
@new{ 'n' .. 'z' } = 14 .. 26;
print "Before change\n";
map{ print "$_ => $hash{$_}\n"} sort keys %hash;
@hash{ keys %new } = values %new;
print "After change\n";
map{ print "$_ => $hash{$_}\n"} sort keys %hash;