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

Re: [MacPerl] Writing line-ending agnostic scripts?



>Michael Schuerig <uzs90z@ibm.rhrz.uni-bonn.de> writes:
>}It's night of the living dead again...
>}
>}Apart from converting line-endings before stuffing files into MacPerl is
>}there a way of writing scripts in a way that they recognize all the common
>}line-endings as what they are intended?
>}
>
>Are you talking about the scripts or text files read by the scripts?  If
>you're talking about Perl scripts themselves, the answer is no.  MacPerl
>wants Mac text, Unix Perl wants Unix text (I just checked), etc.

I think others have accidentally tried running scripts with non-mac
linebreaks. Unfortunately that was the case with the first scripts I tried
and I kept scratching my head why nothing was happening and nearly gave up
MacPerl there and then.

Is there any reason MacPerl can't accept any reasonable definition of
line-ends, or at least throw up a warning if it finds only one line: "this
4,213 byte file was one line, perhaps it needs to be saved with Mac
line-separators?".

I suspect this is more a 'feature' of the Perl interpreter, rather than
anything specific to MacPerl

cheers,
Danny Thomas

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