如何使用< STDIN>在Active Perl中获取用户输入? [英] How to use <STDIN> in Active Perl for getting user input?
本文介绍了如何使用< STDIN>在Active Perl中获取用户输入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,我是perl的新人。我使用Active Perl 5.8.7 Window。当我使用< STDIN>在我的perl代码中获取用户输入,执行后我没有得到任何输出screne。以下是简单的代码:
Hi every one, I am new in perl. I m using Active Perl 5.8.7 Window based. When i use <STDIN> for getting user input in my perl code, after executing i dont get any output on the screne. Following is simple code:
展开 | 选择 | Wrap | 行号
推荐答案
设置在程序的开头:
Set at the beginning of your program:
| = 1;
别忘了严格使用;使用警告;
再次思考通过STDIN与用户交互是否真的是个好主意。
|=1;
Don''t forget use strict; use warnings;
Think again whether it is really a good idea to interact with the user via STDIN.
在print语句之前添加它。
Add this prior to the print statements.
这篇关于如何使用< STDIN>在Active Perl中获取用户输入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文