I've been working on some scripts that had to work on both, linux and windows.

I've used some DBI, LWP and other default-modules like SMTP::Sendmail etc. and didn't have any trouble with using them on a NT-Box & Linux/HP-Ux.
You could get in trouble because of the different styles of pathes used in win/dos and *nix-systems. Like on a win-box an absolute path could be C:/home/giant while it's just /home/giant on *nix for example. I've seen quite lots of scripts that use different regexprs on pathes, especially CGI-Scripts, that's where you have to be careful I think.
Also different on Win-Systems can be output made to console and the way the interpreter is used when doing perl -nle 'print if /test/' <file> it would be perl -nle "print if /test" <file> in windows. Another thing you have to look at is the newline-problem when copying data between these OSes, it happened that I forgot to set the right ftp-type etc and then had lots of ^Ms at the end of each line.

You should also have a look at Perl Port from Perldoc, where you find lots of infos on making your perlcode portable. If you are looking for a good distribution I would suggest you Active Perl, there are lots of Prebuild Modules available for this one.

giant

In reply to Re: General tips for Unix to Windows script migration? by kodo
in thread General tips for Unix to Windows script migration? by Bukowski

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.