-f is a file test operator used to see if a file is plain text. In my code, I was just deleting the file if it existed, and probably should have used -e. More information on file test operators can be found here.
As far as $|++, this stops the buffering of the output. $|=1 is cleaner in this case, so I've updated my old node. For more info on $|++ and $|=1, here are someinteresting, relevantnodes.