當我學習打印數組變量時,發現使用雙引號時插入的空白區域。代碼段代碼如下。你能告訴我爲什麼嗎?使用或不使用雙引號時打印數組變量
#!/usr/bin/perl -w
use strict;
use warnings;
my @str_array = ("Perl","array","tutorial");
my @int_array = (5,7,9,10);
print @str_array;
print "\n";
# added the double quotes
print "@str_array";
print "\n";
print @int_array;
print "\n";
# added the double quotes
print "@int_array";
輸出:
Perlarraytutorial
Perl array tutorial
57910
5 7 9 10