It's been WAAAY too long since I've visited.
Server:
#!/usr/local/bin/perl
use IO::Socket::INET qw(CRLF);
my $client = IO::Socket::INET->new('blade:12333')
or die "new: $@";
while (<$client>)
{if ($_ =~ /file: (.*)/)
{open(FOUT,">>$1") || die "cannot create: $1";}
elsif ($_ =~ /EOF/)
{close(FOUT);}
else
{print FOUT;}
}
Client:
#!/usr/local/bin/perl
use IO::Socket::INET qw(CRLF);
my $client = IO::Socket::INET->new('blade:12333')
or die "new: $@";
while (<$client>)
{if ($_ =~ /file: (.*)/)
{open(FOUT,">$1") || die "cannot create: $1";}
elsif ($_ =~ /EOF/)
{close(FOUT);}
else
{print FOUT;}
}
Besides the obvious perl security/etc. flags, what do think? I wrote this back in 2004 so I'm curious how it holds up, etc.