正如标题所暗示的,我如何才能做到这一点?
我一直在遵循一个教程,但是我得到了一个语法错误:
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;发布于 2011-09-25 19:40:14
2names是无效的变量名。名称不能以数字开头-必须以字母或下划线开头。
https://stackoverflow.com/questions/7545253
复制相似问题