首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

perl的输入输出有关问题

2012-09-10 
perl的输入输出问题use strictuse warningsuse diagnosticsmy (@words, %count, $word)chomp(@words

perl的输入输出问题

use strict;
use warnings;
use diagnostics;
my (@words, %count, $word);
 
chomp(@words = <STDIN>);
foreach $word(@words)
{
  $count{$word} += 1;
}  
foreach $word(keys %count)
{
  print "$word was seen $count{$word} times.\n";
}  


请问为什么运行了程序以后一直停留在输入的状态中,如何让输入结束且运行程序

[解决办法]
unix 下用 ctrl + D

热点排行