[問題] 請問$K=<STDIN>

看板Perl作者 (e )時間15年前 (2010/05/11 11:23), 編輯推噓0(003)
留言3則, 3人參與, 最新討論串1/2 (看更多)
我用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

05/11 12:04, , 1F
我是在xp作業系統下跑的
05/11 12:04, 1F

05/11 15:09, , 2F
linux下面跑沒問題... @ @"
05/11 15:09, 2F

05/11 17:21, , 3F
ide有問題
05/11 17:21, 3F
文章代碼(AID): #1BwCssYR (Perl)
討論串 (同標題文章)
以下文章回應了本文
完整討論串 (本文為第 1 之 2 篇):
文章代碼(AID): #1BwCssYR (Perl)