> If you ftp them in binary mode instead of
> ascii mode yes that will screw it up.

I wanted to elaborate on this since this is a common issue for the
unknowing.

When you tell FTP to use "binary" mode it doesn't modify the file, it just
copies it byte by byte.  If you tell it to use "ascii" mode, then it will
adjust the line endings depending on the source and destination systems.

When you FTP a text file (including code) between different environments be
sure to use "ascii" mode as it will convert the line endings as appropriate.

In general I don't think Perl cares about line endings too much, I think it
can handle most of them (I may be wrong).  ...The root of the problem  is
the sh'bang line.  Unix uses the sh'bang to determine where the Perl binary
is, and Unix (not Perl) can't understand the carriage-return character.

In general I don't think this is an issue if you go from Unix to Windows.
Since Windows generally uses the file extension to determine what kind of
app it is, and doesn't actually need to peek at the file like Unix does.

Rob


-----Original Message-----
From: Dan Muey [mailto:[EMAIL PROTECTED]
Sent: Monday, August 25, 2003 4:46 PM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: RE: Perl Codes Written in Windows Env


> I have a perl script that I developped in a windows machine 
> and it had to be 
> transfered by ftp to a UNIX server. The codes worked fine 
> when I tested them on 
> my windows machine. Is it true that the data could get 
> corrupted while being 
> ftp'ed from Windows to Unix. I was told by the Unix people 

If you ftp them in binary mode instead of ascii mode yes that will screw it
up.

> that they couldn't 
> get the code to work at first because the codes were 
> developped in windows 

What do you mean by "didn't work". They failed completely, output not as
expected, ...
What modules did you use? Are those installed on the unix host?
What errors are you getting? To the screen or a log of some kind?

> environment. Codes are working now though. Just being curious.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to