in reply to Determine whether file is dos or unix format

It's good that you're trying out Perl; congradulations! :-)

Other people have suggested a regular expression you could use to detect whether a dos text file was loaded; the next step you could try is to change the DOS text file into a UNIX text file, by changing the "\r\n" into a "\n".

It's often easier to write smarter programs than it is to get smarter users; so making your program handle DOS text files might be easier than teaching all our end users not to use DOS text files in the first place.

Good Luck! :-)
--
Ytrew

  • Comment on Re: Determine whether file is dos or unix format