perl编程,小弟写了一个程序,想在输入bye时结束程序,请问使用什么函数呢?望高手指点,非常感谢。
while(1){print"Enterwords\n";$key=<STDIN>;chomp($key);open(FD,">newfile.txt");if(exis...
while(1){
print "Enter words\n";
$key=<STDIN>;
chomp($key);
open (FD,">newfile.txt");
if(exists $statistics{"$key"}){
@statistics=@{$statistics{$key}};
print FD "$key: @statistics";
}
else{
print FD "There is no the word:$key\n";
}
close FD;
} 展开
print "Enter words\n";
$key=<STDIN>;
chomp($key);
open (FD,">newfile.txt");
if(exists $statistics{"$key"}){
@statistics=@{$statistics{$key}};
print FD "$key: @statistics";
}
else{
print FD "There is no the word:$key\n";
}
close FD;
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询