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
In reply to Sockets Help by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |