IO::Socket autoflush by default, assume tcp and PeerAddr
Subject: IO::Socket suggestion
The following patch to IO::Socket have this effect:
- put IO::Socket objects in autoflush mode initially
- assume Proto => "tcp" if no Proto is given (IO::Socket::INET)
- a single argument to IO::Socket::INET->new is assumed to be
a PeerAddr specification.
Comments?
It allows the following (rather long) one-liner to work:
$ perl -I. -MIO::Socket -e '$s=IO::Socket::INET->new("www.perl.com:80");$s->print("HEAD / HTTP/1.0\n\n"); print<$s>'
Credited: Andy Dougherty <doughera@newton.phys.lafayette.edu>
Credited: M.J.T. Guy <mjtg@cus.cam.ac.uk>
p5p-msgid: hvi07zvo9.fsf@bergen.sn.no