I can't see anything wrong with this code-sample. Is $/ redefined somewhere in the code we don't see?
Otherwise, My guess would be, that your data originated from *nix or MacOS and you are using a Windows-environment when parsing the file.
If so, make sure you transfer the file as a text-file, not a binairy one.