in reply to I want to use this code multi times

Hello hegaa,

without reviewing all the code but just the error you got it seems that the module complains about the (local) address (and port!) are already in use. It is reasonable.

You can make the local port ( $lport ) a parameter to the script passed as $ARGV[1] ad open that port locally.

After this a little wrapper that call the script each time (16+ million times..) with a new IP and a new port it's a simply thing.

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.