I was syncing the FAQ repository back to bleadperl and I noticed this
change hunk in perlfaq5:
- print $sock "GET / HTTP/1.0" . "\015\012" x 2;
- $document = join('', <$sock>);
- print "DOC IS: $document\n";
-Note the bizarrely hard coded carriage return and newline in their octal
-equivalents. This is the ONLY way (currently) to assure a proper flush
-on all platforms, including Macintosh. That's the way things work in
-network programming: you really should specify the exact bit pattern
-on the network line terminator. In practice, C<"\n\n"> often works,
-but this is not portable.
I'm not attached to the disparaging wording or the particular
MacIntosh reference, but the technical fact that a literal \015\012 is
needed in HTTP has been now lost. If the point was not to show HTTP,
the change is fine (I guess), but I don't know what was the point.
I'm still doing the sync, but whoever did this change should
doublecheck their work.
--
$jhi++; # http://www.iki.fi/jhi/
# There is this special biologist word we use for 'stable'.
# It is 'dead'. -- Jack Cohen