public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* perl inclusion with cygwin
@ 2001-08-11 21:28 Adam Breier
  2001-08-11 22:45 ` Charles Wilson
  0 siblings, 1 reply; 2+ messages in thread
From: Adam Breier @ 2001-08-11 21:28 UTC (permalink / raw)
  To: cygwin

Hi,
I've been using cygwin for about a month as a shell for running perl scripts I've written under windows NT.  I just started using a new computer, so yesterday I downloaded and installed the latest version of cygwin.  Unbeknownst to me at the time, this includes a version of perl; looking back now, I
see that the install log says 
Downloaded contrib/perl/perl-5.6.1-1.tar.gz

For your reference, here's the "starting cygwin install" line so you know exactly when I did this and with what installer version.  
2001/08/10 21:15:58 Starting cygwin install, version 2.78.2.3

Before I continue, I should mention that I think I've fixed everything, and I'm writing just to make a suggestion about the perl you're including, which I'll get to after I explain what happened.

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; 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 (it is certainly the one
endorsed by www.perl.com), 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.

In case you're wondering who I am, I'm a graduate student at UC Berkeley, and the scripts I'm writing are for analyzing DNA replication in the E. coli and yeast genomes.

Best regards,
Adam Breier

--
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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: perl inclusion with cygwin
  2001-08-11 21:28 perl inclusion with cygwin Adam Breier
@ 2001-08-11 22:45 ` Charles Wilson
  0 siblings, 0 replies; 2+ messages in thread
From: Charles Wilson @ 2001-08-11 22:45 UTC (permalink / raw)
  To: Adam Breier; +Cc: 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/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-08-11 22:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-11 21:28 perl inclusion with cygwin Adam Breier
2001-08-11 22:45 ` Charles Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).