in reply to Help with string concat and sockets

Here is some more of the code, in case that's helpful.

# read the first line of the client's reply to determine which
# action to take
$action = <$client>;
chomp $action;
print "action is $action\n";

# set up the variable to match the end tag of the document
$endAction = $action;
$endAction =~ s/</<\//g;

# read the remainder of the client's reply

$testXML = "";
while (<$client>) {

chomp;
if ($_ eq $endAction) {
print "end found\n";
last;
} #endif

print "line: $_\n";
push @clientXML, $_;
$testXML = join '', $testXML, $_;

} # end while

print "testXML is $testXML\n\n";

And here is what the client is sending:
<FOO>
bla
bla
bla
blabababa
end
</FOO>
And here's the result of that print statement in the server:
endbababas bla

As you can see, the "testXML is" doesn't even show up except for that one "s"....
  • Comment on Re: Help with string concat and sockets