天行健,君子以自强不息!
发布时间:2013-03-26 18:01:16
1. Problem如何管理多个输入流The next input to your program could be coming from any number of filehandles, but you don't know which. You've tried using select( ), but the need to then do unbuffered I/O is more than you can deal with (and it's making your code very difficult.........【阅读全文】
发布时间:2013-03-22 22:16:24
一、IO::Socket简介IO::Socket, 它是socket通信的面向对象的Perl接口。IO::Socket下又有两个子类IO::Socket::INET与IO::Socket::UNIX.现在用的是IO::Socket::INET。它的步骤是:先调用new方法,然后就可以进行基本I/O操作(使用print与getline等基本I/O方法)了,最后调用close方法结束会话,那么整个SOCKET会话就算完.........【阅读全文】
发布时间:2013-03-12 14:57:40
一、ALARM方式示例程序:#!/usr/bin/perl$timeout = 2 ;while(1){ eval { local $SIG{ALRM} = sub{print "sorry,time out.please try again\n"} ; alarm $timeout ; #启动定时器 # 实际操作 print "hello world!\n" ; sleep 3 .........【阅读全文】