perl 问题
$ cat test2.pl#!/usr/bin/perl
printf "请问您尊姓大名?";
$name=;
chop($name);
printf "你好,$name,欢迎光临网上教室!\n";
$ perl test2.pl
syntax error at test2.pl line 3, near "=;"
Execution of test2.pl aborted due to compilation errors.
$ chmod +x test2.pl
$ ./test2.pl
syntax error at ./test2.pl line 3, near "=;"
Execution of ./test2.pl aborted due to compilation errors.
$ 我的也是这个问题 #!/usr/bin/perl
printf "请问您尊姓大名?";
$name=<STDIN>;
chop($name);
printf "你好,$name,欢迎光临网上教室!\n";
页:
[1]