I'm writing a script to download a file from HTTP, opening multiple connections to the server (each connection would download a portion of the file).
So I have to open netcat $n times, and get the data from each filehandle, so I'll need some kind of array of filehandles. I know I can't do this:
open(NC[$i],'echo "$header"|nc $host $port|');
I know I can do this:
$handle[$i] = "NC$i";
open($handle[$i],'echo "$header"|nc $host $port|');
but then I can get the data using <NC0>, <NC1>, etc, but not using
<$handle[$i]>
So how could I use an array of filehandles?