|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
Re: open many sockets in scriptby ig (Priest) |
| on Jul 04, 2012 at 21:02 UTC ( #979920=note: print w/ replies, xml ) | Need Help?? |
|
A my variable used inside the loop is local to the loop: you don't need a different variable name for each iteration through the loop so you can just use my $sock. If you want to create all the sockets and have them accessible outside the loop, then you should declare the variable outside the loop and set it inside the loop. In this case, if you want to use integers to access the various sockets I suggest you use an array, rather than differently named variables. Something like:
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||