Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: open many sockets in script

by superfrink (Curate)
on Jul 04, 2012 at 21:05 UTC ( #979921=note: print w/replies, xml ) Need Help??

in reply to open many sockets in script

I would store the sockets in a data structure like an array instead of dynamically creating variable names. eg:
use strict; use Data::Dumper; my @sock_list; for (my $i=0;$i<10;$i++) { $sock_list[$i] = "..." . $i; } print Dumper(\@sock_list);
Update: ++ig

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://979921]
[huck]: "and all is quiet..." "Others having an uproarious good time at the Monastery" ... something seems not quite right ...
[huck]: just the first time i noticed the "uproarious" message ... i must be bored

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2017-02-24 03:07 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (351 votes). Check out past polls.