my @array = qw(aa bb cc dd);my @select = @array[1,3];print "@select\n";##输出bb dd123456
my %hash = ( "a" => 1, "b" => 2, "c" => 3, "d" => 4, );my @select = @hash{qw(a c)}; ## 提取key为‘a’‘c’对应的值print "@select\n";##输出为1 31234567891011
my %hash = ( "a" => 1, "b" => 2, "c" => 3, "d" => 4, );my %select = %hash{qw(a c)}; ##提取key为‘a’‘c’的hashmap {print "$_=> $select{$_}\n"} keys %select;##输出为:a=> 1c=> 3
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。