如标题所示,我该如何实现这个功能?
我一直在跟随教程操作,但是我收到了语法错误的消息:
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;