微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

读-福瑞哈哥-的POE学习笔记

http://bbs.chinaunix.net/thread-908855-1-1.html

wheel部分有个小例子,代码不贴了。

其中有几行:

  1.         # 告诉ReadLine监控终端
     
  2.         $console->get( 'input your message,bye to quit: ');
     
  3.         $heap->{console} = $console;
     

原以为$console->get仅仅是终端输出,所以在copy脚本的时候就删掉了。结果怎么调代码都不回显,server端也收不到东西。

cpan上关于这个get函数的说明:

get

get() causes POE::Wheel::ReadLine to display a prompt and then wait for input. Input is not noticed unless get() has enabled the wheel's internal I/O watcher.

After get() is called,the next line of input or exception on the console will trigger an InputEvent with the appropriate parameters. POE::Wheel::ReadLine will then enter an inactive state until get() is called again.

Calls to get() without an argument will preserve the current prompt. Calling get() with an argument before a whole line of input is received will change the prompt on the fly.

悲催啊。。。。。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐