in reply to sorting numbers

It will likely be much simpler if you just open and close once, and if you're really just going to write out columns of numbers then you could do something like this
open(COUNT, ">>count.txt") or die("Can't create count.txt: $!\n"); print COUNT $_, ' ', $_ + 10, $/ for 1 .. 10; close(COUNT);
Which produces a file of two columns with the first column being 1 .. 10 and the second column 11 .. 20. If however you want to arbitrarily print 2 columns of numbers then the zip function from the Language::Functional module will be of help.
HTH

_________
broquaint