作者outlaw0 (e )
看板Perl
标题[问题] 请问$K=<STDIN>
时间Tue May 11 11:23:32 2010
我用open perl ide 1.0.11.409
程式码如下:
print "Please enter the number of K: \n";
my $K=<STDIN>;
if ($K eq "\n"){
print "K is not been defined \n";
}
else {print "K is $K"};
但在输出视窗中,"Please enter the number of K:" <==这行
竟然要等到我输入K值後才出现 @"@,
变成
5Please enter the number of K:
K is 5
请问这是正常的吗?
那我该如何在输入值前先印一些资讯在输出视窗中呢?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.116.214.59
1F:→ outlaw0:我是在xp作业系统下跑的 05/11 12:04
2F:→ dryman:linux下面跑没问题... @ @" 05/11 15:09
3F:→ jlovet:ide有问题 05/11 17:21