[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Re: Newlines



At 8:03 PM -0400 10/12/97, David Turley wrote:
>Forgive me, but I just don't get this LF/CR problem. I write my scripts
>most of the time in BBEdit, but about 25% of the time I am forced to use a
>Win(% machine, and UltraEdit. I run the scripts under MacPerl on my Mac,
>under the Win port of Perl when at work, and on several Unix boxes. I have
>never had a problem with LF/CR on any machine with any script. When exaclty
>does this prblem crop up?

I have a simple test script up in BBEdit:

#!/usr/bin/perl5
print "Hello World\n";


With Mac file format, the output is:

Hello World

As expected.

With Unix file format, the output is nothing... no error... nothing.

With DOS file format, the output is:

# Illegal character \012 (carriage return).
File 'NIN:Development:MacPerl:test2.pl'; Line 2
# (Maybe you didn't strip carriage returns after a network transfer?)

My initial question is *not* how can I convert my files.... I do that all
day long going between Mac and Unix systems.

My questions has to do with my concern that I'll have to maintain two
sources of my perl scripts... one for Unix and one for Mac.

This also leads to concerns about how MacPerl sees a EOL while doing file
manipulation.... as in:

# Open html
open(HTML,$filename) || die;
while (<HTML>) {
  print;
}

Is MacPerl going to only be able to read Mac formated files for end of
lines?  I haven't gotten that far in my testing yet to see what I'll run
into.

So far, my port is having some problems.... MacPerl seems to give some
compiler warnings that Perl under BSDI does not give (variables not being
used, etc).  I suspect it's having some issues with some of my eval'd code
with similar issues.

Maybe 'use strict' works slightly different under MacPerl?

mark

PowerPerl(tm),  mailto:info@powerperl.com   http://www.powerperl.com
       A product of Tyrell Software Corp.   http://www.tyrell.com



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch