in reply to Reading an incoming Data Stream..
I don't see a chomp() in there anywhere, so I'll bet you have a newline hanging on to the end of the string. Try
if ($buf eq "\"END\"\n") ^^
In Section
Seekers of Perl Wisdom