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

[MacPerl] Re: line termination VS. perl libraries



>From: Tom Sackett <tsackett@adobe.com>
>
>I would like to create a few cross-platform libraries that will provide a
>set of subroutines to be used by both Macintosh and Windows computers. The
>code itself is cross-platform; it will work on both kinds of machines.
>However, before a script can load one of the libraries (using "use"), I
>have to make sure that has the right line termination.
>
>I would really, really, like to to have a single copy of each library on a
>central server that would be accessed by both the Macs and Windows
>machines, but I'm forced to keep two copies of each library that differ
>only in that one has the Mac CR line termination and the other has DOS CRLF
>line termination.
>
>Is there any way around this problem?

In theory you should be able to configure clients and server to know about a
text/x-perl MIME type and let them do EOL translation for you, but I've
noticed that implementation of EOL translation over http seems to work right
only rarely.

I've been able to configure IE 4.5 under MacOS 8.6 to download PERL files
from a unix FTP server (ftp.best.com, referenced by a web page on an http
server) and it does the appropriate EOL translation and sets the MacOS file
signature appropriately.  You can configure these setting in IE or with the
Internet control panel or with the Internet Config utility.

Assuming your users are not eager to configure their MIME settings (and that
might not work anyway...), I would recommend storing your files on an FTP
server and telling people to download your stuff with an FTP client in ASCII
mode.  FTP has been doing this right for 18 years now...

I think it's a red herring, but I'll note that apache uses a mime.types file
to set mappings and that html permits an <a> tag to indicate a target's MIME
type as the 'type' attribute of the tag.

Alternatively, if only your code will "use" your libraries, maybe you could
set the EOL convention explicitly in your PERL code (by setting $/) just
before you "use" your library.  I haven't tried this.  Good luck!
--cvs

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org