Perl에서이 map 문이 컴파일되지 않는 이유는 무엇입니까?
이것은 실패합니다 :my @a = ("a", "b", "c", "d", "e");
my %h = map { "prefix-$_" => 1 } @a;
이 오류와 함께 :
Not enough arguments for map at foo.pl line 4, near "} @a"
이 작동 :
my @a = ("a", "b", "c", "d", "e");
my %h = map { "prefix-" . $_ => 1 } @a;
왜?