Have you tried it? I recommend you write three tests - one with source text with each line-ending style. Verify that it works correctly with the original code. Then make your change and see if it still works. If it does, you're done. If not you'll need to learn more about what chomp() does.
For bonus points, write your tests using Test::More!
-sam