#!/usr/bin/perl use strict; use warnings; use Net::EasyTCP; # Configuration settings our $host = 'myhost.mydomain.mytld'; our $port = 7716; our $password = 'secret passphrase or whatever'; # Implementation foreach my $file (@ARGV) { unless (-e $file) { print "No such file: '$file', skipping\n"; } open F, '<', $file or die $!; my $data = { password => $password, filename => $file }; { local $/ = undef; $data->{put} = ; } close F or die $!; print "Connecting to server...\n"; my $client = new Net::EasyTCP( mode => "client", host => $host, port => $port, ) || die "ERROR CREATING CLIENT: $@\n"; print "Connected. Sending $file...\n"; $client->send($data) || die "ERROR SENDING: $@\n"; print "Sent. Reading reply...\n"; my $reply = $client->receive() || die "ERROR RECEIVING: $@\n"; print "Reply was: '$reply'\n"; $client->close(); } print "Done.\n";