请高手帮我看看这样编错在哪了,谢谢

请高手帮我看看这样编错在哪了,谢谢

请高手帮我看看这样编错在哪了,谢谢
#!/usr/bin/perl -w
%my_telphonenumbers=(
"liu"=>134,
"zhang"=>134,
"wang"=>134,
"su"=>"134",
);
print "please input the name you want to find:)\n";
chomp($input_name=<>);
if(exists $my_telphonenumbers{$input_name}) #line 10
{
&display_numbers;
}
else
{
print "sorry:(\nthe name,$input_name,you input did not exit in the list\n";
print "would you like to establish $input_name`s list?\nif you want please press Y for yes\nnor press N for no\n";
if(chomp($press=<>)=~y)
{
print"please input $input_name`s telnumber\n";
chomp($input_numbers=<>);
$my_telphonenumbers{$input_name}=$input_numbers;
}
else
{exit;}
}
sub display_numbers]
{
print "there are indeed the name in the list\nplease wait\n";
print "$input_name`s telnumber is $my_telphonenumbers{$input_name}\n";
}
呵.有没有试过用PERL运行?.
有问题
Transliteration replacement not terminated at test.pl line 21.
再仔细调试调试,程序是有点问题




   

#!/usr/bin/perl -w--%m.
#!/usr/bin/perl -w
%my_telphonenumbers=(
"liu"=>134,
"zhang"=>134,
"wang"=>134,
"su"=>134
);
print "please input the name you want to find:\n";
chomp($input_name=<>);
if(exists $my_telphonenumbers{$input_name}) #line 10
{
&display_numbers;
}
else
{
print "sorry:(\nthe name,$input_name,you input did not exit in the list\n";
print "would you like to establish $input_name`s list?\nif you want please press Y for yes\nnor press N for no\n";
if(chomp($press=<STDIN>) && $press=~/y|Y/)
{
print"please input $input_name\'s telnumber\n";
chomp($input_numbers=<>);
$my_telphonenumbers{$input_name}=$input_numbers;
}
else
{exit;}
}
sub display_numbers
{
print "there are indeed the name in the list\nplease wait\n";
print "$input_name`s telnumber is $my_telphonenumbers{$input_name}\n";
}
帮你改过了,你再仔细看看吧,这个我试过,没任何问题
if(chomp($press=<>.
if(chomp($press=<>)=~y)

应该是 =~ /y/

sub display_numbers]

那个 ] 有是什么? 贴出程序时请至少运行一遍。。

另外你的程序应该使用 strict 模块,应该用 my 声明变量等等。请到 perlchina 首页把 use strict 和如何 debug 程序的文章看看。
[CCB]1[/CCB]--谢谢各位.
[CCB]1[/CCB]
谢谢各位大哥大姐[CCB]6[/CCB]