in reply to sorting and array by [2]

Your question is quite unclear, not to say "gibberish" (but i don't use this word for a certain reason).

Assuming you have an input-handle that serves the information you described linewise as "IP NUM1 NUM2" and you're reading that stuff into an array of arrays:

while(<INPUT>){ chomp; push @array,[split]; }

You'll only have to sort by the third element of each arrayref now:

@sorted = sort { $a->[2] <=> $b->[2] } @array

I can actually not see the problem, because each code example in your post is nonsense.

--
http://fruiture.de