This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: perl + automode.o


Christopher Faylor wrote:

> On Fri, Aug 24, 2001 at 05:53:08PM +0200, Gerrit P. Haase wrote:
> 
>>Hi,
>>
>>I compiled a version of miniperl with automode.o linked
>>in. First tests shows that it adresses the CR/LF problem.
>>
> 
> I don't think that compiling a general purpose programing package like
> perl with automode is a good solution.
> 
> It just pushes the CRLF problem onto a different class of users.


Let me chime in here...after thinking about this a little harder, I 
don't think "automode" is the right solution.  But first, let's define 
the problem.

(1) Using Unix-line-endings on Unix(binary) mounts:
      no problem
(2) Using DOS-line-endings on DOS(text) mounts
      no problem?

(3) Using Unix-line-endings on DOS(text) mounts
      no problems reading, but output files get extraneous ^M's on disk. 
  That's okay though, because perl can still read them in (case #2 above)

(4) Using DOS-line-endings on binary mounts
      main problem.

Using automode will read the files in text(DOS) mode, and write them in 
binary(UNIX) mode.  But what if the file is actual *binary* data, and 
not *text* at all?

What if you read a file into memory, close the file, open for write, and 
the write the data back out.  Through no intention or fault of your own, 
if perl is linked with automode you've just done a DOS to UNIX conversion.

Maybe Chris' chomp() suggestion is the right thing.

I thought Eric had tracked down and squashed these bugs back in the 
5.005_62 days, but then it reappeared in the 5.6.1-TRIAL release.  Eric, 
any ideas?

--Chuck



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]