in reply to About Broadcasting
You don't tell us how it does not run for you. From a cursory inspection, I guess that one of the errors is on the following line:
sysread(STDIN,$data,1024)||exit 0;
I suggest you change that line to:
if (! my $res = sysread(STDIN,$data,1024)) { if (defined $res) { print "End of user input. Thanks for playing.\n"; exit 0; } else { die "Couldn't read from input: $!"; }; };
But as it's inconvenient for me to duplicate your situation or to check what sysread returns when there is no input to be read from STDIN, maybe you care to tell us more about how your code does not work for you. Maybe Perl tells you something about it?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: About Broadcasting
by LH2007 (Initiate) on Nov 05, 2007 at 12:00 UTC | |
by Corion (Patriarch) on Nov 05, 2007 at 12:05 UTC | |
|