perlcraft
Corion
#!/usr/bin/perl -w
# As our unix printer setup is weird and I sometimes want to
# print to networked (HP) printers, I needed something like
# netcat. I was unsatisfied with <tt>telnet</tt>, as it did
# output stuff I didn't want, and I didn't want to add the
# redirection to /dev/null. Perl to the rescue:
use strict;
use IO::Socket;
select IO::Socket::INET->new(PeerAddr => shift, PeerPort => (shift || 23));
print
for <>;
__END__
# or, as a oneliner:
perl -MIO::Socket -pe 'BEGIN{select IO::Socket::INET->new(PeerAddr=>shift,PeerPort =>(shift||23))}'