i'm printing a new line into a file and then i sort it and print it back onto itself. i'm using the following code for the sorting and printing:
## sort the new list of virtusers
open(FH, $virttmp);
@virtusers = <FH>;
close(FH);
## write sorted file contents back onto itself
open(FH, ">$virttmp");
print FH (sort @virtusers);
close(FH);
this seems neat enough, but is there a quicker way to do this? i dont believe that sort can be used on a filehandle, but is this really the most efficient way to get the desired results?
humbly -c