in reply to Re: About Broadcasting
in thread About Broadcasting

I have changed this code but it warn: "Can't modify not in scalar assigment at   if (! my $res=sysread(STDIN,$data,1024)) zzz.... I'm very confuse,i don't know why and how

Replies are listed 'Best First'.
Re^3: About Broadcasting
by Corion (Patriarch) on Nov 05, 2007 at 12:05 UTC

    Ah, that's a typo/thinko by me. Moving the expression part before the if statement works, but you could have tried out that yourself.

    ... my $res = sysread(STDIN,$data,1024); if (! $res) { if (defined $res) { print "End of user input. Thanks for playing.\n"; exit 0; } else { die "Couldn't read from input: $!"; }; }; ...

    Let me remind you that you still haven't told us at all how the program is failing for you and at what step. Without that knowledge, we cannot help you much and all we can do is guess based on cursory inspection of your code.

    A reply falls below the community's threshold of quality. You may see it by logging in.