in reply to Creating an outputfile and processing it at once

Assuming you are looking for non-perl related command line solution

 perl othercode.pl | tee othercode.out | perl thiscode.pl