romm has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to write an asynchronous client capable of readline capabilities. Below are excerpts from the code Async is achieved through:
	vec($rin,fileno($game),1) = 1;
	vec($rin,fileno(STDIN),1) = 1;
	select($rout=$rin, undef, undef, undef);
	#Here goes input capture
        if (vec($rout, fileno(STDIN), 1)) {
	    $line = $term->readline('');
		# but readline seems to be masked and doesn't
		# work
  • Comment on How to combine asyncrhonous I/O and readline?

Replies are listed 'Best First'.
Re: How to combine asyncrhonous I/O and readline?
by merlyn (Sage) on Feb 11, 2002 at 12:38 UTC
    Right. You can't mix buffered I/O (readline, read, seek, and so on) with unbuffered operations (select, sysread, sysseek). So stay with sysread, and all will be well. For more complicated applications, look into POE.