当我学习打印数组变量时,我发现使用双引号时插入了空格。片段代码如下。你能告诉我为什么吗?
#!/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