All pastes #543217 Raw Edit

Untitled

public text v1 · immutable
·published 2007-06-06 00:56 UTC
rendered paste body
#!usr/bin/local/perl
use IO::Socket;		
$recipient = $argv[1];
$message = <>;

sub connect_and_send {
	my $sock = new IO::Socket::INET (
		PeerPort => 5000,
		PeerAddr => $recipient;
		...
	die "$!" unless $sock;

#opens a port for listening purposes
sub open_listening_socket{
	my $sock = new IO::Socket::INET ( #socket variable
		LocalPort	=> 5000,
		Proto	=>	'tcp',
		Listen	=> 1);
die "$!" unless $sock;
sleep(10);
close($sock);
}
#end listen block