binbindatou 发表于 2004-4-24 02:22:23

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.
$

荆棘鸟 发表于 2004-4-25 20:34:25

我的也是这个问题

redspiderr 发表于 2004-4-25 21:15:31

#!/usr/bin/perl
printf "请问您尊姓大名?";
$name=<STDIN>;
chop($name);
printf "你好,$name,欢迎光临网上教室!\n";
页: [1]
查看完整版本: perl 问题