in reply to Re^2: Local socket model
in thread Local socket model

What string does the C server send after it accepts the connection? It does have a newline in it, right?

Replies are listed 'Best First'.
Re^4: Local socket model
by Anonymous Monk on Oct 07, 2008 at 14:26 UTC
    A NEWLINE!!! What's wrong with a good ol' fashioned "null terminator"?!!? wow...thanks.
      Yes, the <> operator is the equivalent of fgets (with an essentially unlimited length value) in C.
      Then perhaps you want to redefine what <> considers a line?
      local $/ = "\0"; # Read up to NUL. while (defined(my $messg = <TSOCK>)) { chomp $messg; # Remove NUL. print "$messg\n"; print TSOCK "Hello server!\n"; TSOCK->flush; }