【发布时间】:2011-09-25 11:37:39
【问题描述】:
正如标题所示,我该如何做到这一点?
我一直在学习一个教程,但是我收到了一个语法错误:
Bareword found where operator expected at arrays_and_variables.pl line
26, near "$2names"
(Missing operator before names?) syntax error at
arrays_and_variables.pl line 26, near "$2names " Execution of
arrays_and_variables.pl aborted due to compilation errors.
我目前的代码是:
@names = ('james','dylan','max');
# join elements of array into a schalar variable.
$2names = join ('', @names);
print $s2names;
【问题讨论】:
-
使用严格;使用警告;在你的程序顶部将有助于捕捉这些东西。
标签: perl