I have a problem I need to do a program that can move file from the computer on to the server, they told me that via socket I could do it, so I read a bit and did these program
use IO::Socket;
my $server = IO::Socket::INET->new(
PeerAddr => 'localhost',
PeerPort => 7888,
Proto => 'tcp'
) or die "Can't create client socket: $!";
open FILE, "hello.txt";
print "Enviando informacion";
for (my $dots=1;$dots<=100;$dots++){
print "*";
}
print "\n\n\n";
while (<FILE>) {
print $_;
print $server $_;
}
close FILE;
the server is this
use IO::Socket;
my $server = IO::Socket::INET->new(
Listen => 5,
LocalAddr => 'localhost',
LocalPort => 7888,
Proto => 'tcp'
) or die "Can't create server socket: $!";
my $client = $server->accept;
open FILE, ">out" or die "Can't open: $!";
while (<$client>) {
print FILE $_;
}
close FILE;
but the thing is that these program only sends one program and I need to send many files that are store in a solder in my pc to the server but I have no idea on how to do that, can someone help me.
The ideas is simple on the flder of the PC everytime a file gets save there must be send to the server sometimes they save 2 or 15 files there so I need to send them all via socket to the server how can I do that? I have no idea can someone help me?
thanks