[Bioperl-l] Root::IO handle Mac and Win32 LF

Dave Howorth dhoworth at mrc-lmb.cam.ac.uk
Tue Dec 16 07:04:52 EST 2003


Aaron J. Mackey wrote:
>> I.e Windows terminates lines with \r\n but a Mac perversely reads them 
>> as \n\r.
> Actually, it seems that there are some Mac-derived files with only \r, 
> and no \n at all (as a recent example, EndNote 6 exported bibliographies 
> have no \n's, only \r's by od -c's reckoning).

Now you've confused me again.  What do you mean by \r?  Are you saying 
there are some Mac files with only \012 or with only \015?  That is are 
you speaking as a Unix/Linux/Windows user or as a Mac user?

This is why it's better not to use \r and \n at all in this context.

>> I think for portable code it's better to write the regexps using the 
>> octal values: \015 instead of CR and \012 instead of LF.
> We don't have issues writing files, only reading one-line-at-a-time and 
> canonicalizing it (why do we need to canonicalize it again, Jason?)

I wasn't talking about writing files, I was talking about writing the 
regexps that are used for reading files. (But as the section I quoted 
from Perldoc points out, there *are* issues with writing files if you 
want to use them with some network protocols :)

Cheers, Dave
-- 
Dave Howorth
MRC Centre for Protein Engineering
Hills Road, Cambridge, CB2 2QH
01223 252960



More information about the Bioperl-l mailing list