nysus has asked for the wisdom of the Perl Monks concerning the following question:
I'm still getting line input and output, however. The input is running in one process and the output is running in another. In other words, the output subroutine above is the only part of the program running so the problem is definitely within the bounds of this subroutine. I turn humbly to the PerlMonks community for wisdom.sub user_to_host { my $s = shift; # Note: $s is the socket my $buffer; STDIN->autoflush(1); while (read (STDIN, $buffer, 1)) { print $s $buffer; } } # ATTEMPT #2 sub user_to_host { my $s = shift; my $buffer; STDIN->autoflush(1); while ($s) { read (STDIN, $buffer, 1); print $s $buffer; } }
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop";
$nysus = $PM . $MCF;
Click here if you love Perl Monks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Getting byte stream input from STDIN
by bikeNomad (Priest) on Jul 27, 2001 at 00:02 UTC | |
by nysus (Parson) on Jul 27, 2001 at 00:05 UTC | |
|
Re: Getting byte stream input from STDIN
by larryk (Friar) on Jul 27, 2001 at 01:03 UTC | |
|
Re: Getting byte stream input from STDIN
by nysus (Parson) on Jul 27, 2001 at 00:03 UTC | |
by bikeNomad (Priest) on Jul 27, 2001 at 00:19 UTC |