This is the mail archive of the cygwin@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 inclusion with cygwin


Adam Breier wrote:
 >
 > I started getting strange results from a script that worked fine on
 > another machine, and after much puzzling I figured out that for
 > some reason on the new machine some lines (but not all) of the
 > input file was being considered to have \r\n line termination,
 > whereas in all the programming I've done under windows 95/98/NT,
 > I've assumed with no problem that there's only a \n and a single
 > chop command is sufficient to get rid of it.  What was really
 > puzzling was that if I ran the script as ./scriptname.pl, it worked
 >  fine (it was using the activestate perl I have installed--build
 > 628, v5.6.1) but if I ran it as perl scriptname.pl (which used the
 > cygwin perl), bad things happened because there were \r characters
 > floating around where there shouldn't be.
 >
 > So that was a pain.  My suggestion to you is that if you are going
 > to include perl with cygwin, please include the activestate
 > version;

Not gonna happen.  The ActiveState perl doesn't grok cygwin paths, and 
is just not unix-like in a lot of ways.  Besides, why would we include a 
non-cygwin binary in a cygwin distribution?  (also, you can just choose 
not to install "our" version and use AS instead).

 > I don't know where the one you used came from, but it is
 > my impression that activestate is the standard for use in windows
 > environments

A-hah!  But cygwin is not windows.

 > (it is certainly the one endorsed by www.perl.com),

Sure.  for "raw" W95, W98, WMe, WNT, W2K.  But they don't mention cygwin 
-- because cygwin is not really windows.

 > and a difference in behavior in something as important as line
 > termination will probably throw a lot of windows perl programmers
 > if they give cygwin a try.

Well, there's actually a LOT of things that may throw windows 
programmers if they jump over to cygwin (or linux, for that matter). But 
that's a whole 'nother story.

If there is a line ending problem with cygwin-perl (and there is), then 
it needs to be fixed, and we want to fix it.  Unfortunately, the 
cygwin-perl volunteer maintainer is MIA right now.

in the interim, a fix is to mount your drives in "text mode" or "DOS 
mode" instead of "binary mode/Unix mode".  (Run setup, click "DOS", but 
don't install anything).

Another fix is to convert your .pl files to unix line endings. ASperl 
will grok those, AFAIRC.  And cygwin-perl will be happy.  And every text 
editor on the planet (except notepad) can understand both types of line 
endings.  If you're using notepad to edit your perl scripts...see a 
shrink. :-)

--Chuck




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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