Thanks. I was using codepad.org to run some code, and per your suggestion if I switch \n to \r\n, then my code works. I was using codepad.org to run some code using a windows computer, but I still don't quite understand why perl doesn't seemlessly translate \r\n to a \n. When I hit return on a windows computer, I should be entering \r\n--not just \r.