in reply to Reading an incoming Data Stream..
Better would be one of the two following snippets:
The first does a regex, avoiding the newline issue. The second removes the trailing newlines, then does a string comparison.while (defined ($buf = <$new_sock>)) { if ($buf =~ /"END"/) { } } ---- while (defined ($buf = <$new_sock>)) { chomp $buf; if ($buf eq '"END"') { } }
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
In Section
Seekers of Perl Wisdom