玩 Hash 我遇到了以下输出,不知道为什么会这样。默认情况下,哈希中是否有嵌入的空格?
#! /usr/bin/perl
# playwhash
use warnings;
use strict;
my %normal = ("Tom ","5'3","Peter ","5'11","John " ,"5'7",);
foreach (1..6) {
print each %normal, "\n";
}
输出看起来像
Peter 5'11
Tom 5'3
John 5'7
Peter 5'11
Tom 5'3