On 10/08/2002 at 17:43, Shannon Murdoch, [EMAIL PROTECTED] wrote:

>Hi all,
>
>My scripts, which are running perfectly well on a Win2000 webserver, do 
>not
>function correctly under MacOS X.
>
>The first thing I've been able to identify that is malfunctioning is the
>standard file reading process I've always used:
>
>while(<FILE>){
>  push (@array,$_);
>}
>
>print $array[1];  ##prints the second line of file
>
>For some reason MacOS X reads the entire file in to $array[0] the first 
>time
>round, instead of putting one line per array element.

The problem you're encountering here is that Win32, Macs (classic version) and Unix 
interpret line endings differently.

Macs use CR, Unix uses LF and DOS CR/LF.

So, when using files across platform, you have to save the file with the appropriate 
line breaks for the system you're using which, in this case, being Mac OS X, LF.

Regards,

Phil.

Reply via email to