正如標題所示,我該如何實現這一目標?Perl語法錯誤:在操作員期望的地方發現了Bareword
我一直在下面的教程,但我得到一個語法錯誤:
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;
使用嚴格;使用警告;在你的程序的頂部將有助於抓住這個東西。 –