注册 登录
编程论坛 Perl论坛

undefined subroutine :chmop called at <STDIN> line 1

lyl930130 发布于 2016-10-24 10:51, 4443 次点击
错误提示:
undefined subroutine &main :: chmop called at ./a.pl line 9 , <STDIN> line 1.

代码如下:
程序代码:
#!/usr/bin/perl
$a = 3.141592654*2*12.5 ;
$pi = 3.141592654;
print "$a\n\n";

print "input the radius of a circle : ";
#$radius = 3;
$radius = <STDIN>;
chmop ( $radius );
#chmop ( $radius = <STDIN> ) ;
$circ = 2 * $pi * $radius ;
print "the circumference of the circle of raidus $radius is $circ\n";
1 回复
#2
lyl9301302016-10-25 16:47
脑子进水了。。是chomp不是chmop
1