开发者

Perl syntax error: Bareword found where operator expected

As the title suggests how could I accomplish this?

I have been following a tutorial, but I get a syntax error:

Bareword found where operator expected at arrays_and_variables.pl line
26, near "$2names"
        (Missing operator before names?) syntax error 开发者_JS百科at
arrays_and_variables.pl line 26, near "$2names " Execution of
arrays_and_variables.pl aborted due to compilation errors.

The code I have so far is:

@names = ('james','dylan','max');

# join elements of array into a schalar variable.
$2names = join ('', @names);
print $s2names;


2names is an invalid variable name. Names can't start with a number—they have to begin with a letter or an underscore.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜