johndoe3344
Programmer
I have a question on how to print to different files, say, out.1.txt, out.2.txt, etc.
If i have
open (OUTP, ">out.txt")
print OUTP "$_";
in some sort of loop, then out.txt only stores the information in the last iteration of the loop because all the other attempts were overwritten. What I'm looking for is for the first iteration to print to out.1.txt, the second iteration to out.2.txt, and so on.
Could someone tell me how to do this or point me to a webpage which explains it?
If i have
open (OUTP, ">out.txt")
print OUTP "$_";
in some sort of loop, then out.txt only stores the information in the last iteration of the loop because all the other attempts were overwritten. What I'm looking for is for the first iteration to print to out.1.txt, the second iteration to out.2.txt, and so on.
Could someone tell me how to do this or point me to a webpage which explains it?