On the other hand, a C program to perform the same function (actually it does a little more, but we won't quibble...) is about 70 lines, not including comments!
#!/usr/local/bin/perl use IO::Socket::INET; $sock = IO::Socket::INET->new(PeerAddr => 'ironbark', PeerPort => 'finger(79)', Proto => 'tcp'); print $sock "pscott\n"; while(<$sock>) { print; }
Lecture 9: Socket Programming Interface | Copyright © 2005 P.Scott, La Trobe University Bendigo. |