Newlines and chomp is not a big problem, since normally (non-binary) files automatically normalize the newline character to a single "\n" anyway. For most scripts, the difference is invisible.

And even among a single platform, is a newline character "\n", "\N{LINE SEPARATOR}", or "\N{PARAGRAPH SEPARATOR}"? (It's ironic that the Unicode documentation for the latter two use the term "unambiguously").

The ActiveState documentation includes sections on what's different re the built-in functions and semantics.

Windows has COM/OLE, and the Registry. Porting programs to *nix will have to overcome this lack and approach problems in different ways (e.g. there is a portable Word document reader; is there a Perl interface for it?).

Re case sensitivity: a.txt and A.txt are allowed in the same directory on NTFS (and possibly network-mounted file systems). But you'll have problems referring to them without using tools compiled with the POSIX subsystem, or special flags passed to CreateFile (the low-level open API) which Perl doesn't do.

Paths: On Windows, it's a backslash. But slash is taken as an alias most of the time. Perl programs commonly use a slash and ignore this. But what if you have a filename with a backslash in it? Likewise, on a Mac, a file named "notes 12/23/99" is legal--what's Perl going to do with that?

Special characters: In Win32, only backslash, slash, and colon are special. No big deal about the rest, just like in *nix.

Here's a new one: file permissions models differ.

Details of globbing varies.

In *nix, globbing is done by the shell. In Windows, the command tail is passed in as a single string. In Mac, what arguments?

Win32 and Be have multiple data streams in a file. Mac has resource forks. *nix has nada. Beware copying files by simply rewriting the contents!

*nix can unlink an open file. Win32 can't (not sure if it's inherent or has to do with the flags it uses).

*nix uses "magic number" at beginning of a file and #! to associate files; Mac has metadata for that; Windows uses extensions, metadata, and/or general content pattern matching.

Symbolic and hard links.

Single-rooted file system vs. a forest of individual volumes.

deamons vs. services (what's on a Mac?)

Forking as an OS primitive vs. Process model.

—John


In reply to Re: Platform Differences by John M. Dlugosz
in thread Platform Differences by dragonchild

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.