padawan_linuxero has asked for the wisdom of the Perl Monks concerning the following question:
the server is thisuse 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;
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.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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Send many file via socket
by samtregar (Abbot) on Apr 03, 2008 at 20:26 UTC | |
by runrig (Abbot) on Apr 03, 2008 at 20:45 UTC | |
|
Re: Send many file via socket
by CountZero (Bishop) on Apr 03, 2008 at 21:27 UTC |