in reply to Japhaholic

Here are a couple of tricks which might help you with your next JAPH:

if you want to open your program's own source, instead of "open(FH,$0)" you can just use "open+0", and then you can use <0> to read lines.

Instead of using \n for newlines use the variable $/ which is automatically set to a newline when your program starts