Sorry, it starts on line 15. Thanks for the reply. It is working now. And I like your way of the while loop much better than what I used. However, I'm new to perl and don't fully understand your for loop. I assume the "13 .." just means start at 14 but why is there a '#' in front of the fileContents and why $ instead of @? Java was my first language so perl is very different and its taking a lot of getting used to.
Thanks for the replies!