And actually, Perl is a perfect tool for this sort of thing. There are two books out there I recommend you buy - O'Reilly's the Perl Cookbook and Addison-Wesley's Network Programming with Perl.
But to get you set up - here is a sample server straight from the cookbook:
and here is a sample client:use strict; use IO::Socket; my $sock = new IO::Socket::INET (LocalPort => 1200, Proto => 'tcp', Listen => 5, Reuse => 1, ); die "Can't connect: $!\n" unless $sock; while (my $new_sock = $sock->accept()) { my $msg = <$new_sock>; print "client said '$msg'\n"; } close $sock;
This is just a simple example - look into IO::Socket and also Socket.use strict; use IO::Socket; my $sock = new IO::Socket::INET (PeerAddr => '127.0.0.1', PeerPort => 1200, Proto => 'tcp', ); die "Can't create: $!\n" unless $sock; print $sock "send money!"; close $sock;
Jeff
R-R-R--R-R-R--R-R-R--R-R-R--R-R-R--
L-L--L-L--L-L--L-L--L-L--L-L--L-L--
In reply to (jeffa) Re: Port stuff
by jeffa
in thread Port stuff
by Monolith-0
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |