读-福瑞哈哥-的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.

悲催啊。。。。。

相关文章

1. 如何去重 #!/usr/bin/perl use strict; my %hash; while(...
最近写了一个perl脚本,实现的功能是将表格中其中两列的数据...
表的数据字典格式如下:如果手动写MySQL建表语句,确认麻烦,...
巡检类工作经常会出具日报,最近在原有日报的基础上又新增了...
在实际生产环境中,常常需要从后台日志中截取报文,报文的形...
最近写的一个perl程序,通过关键词匹配统计其出现的频率,让...