recursive perl?

Here's what I'd like to do (unwise as it is) in a perl script: 1. pipe a perl script into a perl subprocess and capture the output into a file (easy) 2. change the output of the perl subprocess to another file (also easy: just pipe in an open(STDOUT, ">$file")) 3. Take the output of #1 and pipe that into the perl subprocess.