Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Okay would I be able to get my socket connections into an array, and the use those connectons? Please help oh great ones#!Perl #use strict; use IO::Socket; #use Win32::SerialPort; $|++; print "how many"; $a=<STDIN>; $i=0; while($i <= $a){ print "ip"; $b[$i]=<STDIN>; chomp($b[$i]); print "port"; $p[$i]=<STDIN>; chomp($b[$i]); $i++; } $i=0; while($i <= $a){ $c[$i]=new IO::Socket::INET(PeerAddr=>$b[$i], PeerPort=>$p[$i], Prot +o=>'tcp') || warn "Can not connect: $! $_"; $c[$i]->recv($buffer,1024); print $buffer; $i++; }
janitored by ybiC: Balanced <code> tags around codeblock, as per Monastery convention
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sockets Help
by castaway (Parson) on Aug 24, 2004 at 05:30 UTC | |
|
Re: Sockets Help
by NetWallah (Canon) on Aug 24, 2004 at 05:34 UTC | |
by Anonymous Monk on Aug 25, 2004 at 02:47 UTC |