Hi Monks, I need to port a perl script to windows.I want to know that is there some direct way to do it or I need to change all the unix commands which i have used in my script?

If you mean Perl builtins that have their roots in Unix culture, then you won't need to change anything. However, if you've been calling actual external system commands (e.g., with backticks, system, or exec), then that's inherently unportable. (It's often not even portable from one Unix to another, unless you know what you're doing. For instance, `ps -A` works on Linux, but on some unices you have to use `ps -x` instead. On Windows, of course, ps is not a command at all.)

Another thing to note is that if you have hardcoded any paths, you'll have to change them. However, you *should* be reading in paths from a configuration file or the command line (unless your code is all in a single file, in which case you can just set them in variables at the very top of the script). Hardcoding paths leads to trouble even if you don't end up porting to a completely different platform.

The biggest pain in moving to Win32 is that with the most popular Perl distribution (from ActiveState), there's no CPAN support out of the box. There's ppm, but it's just not the same. If you rely heavily on the CPAN, you may end up needing to go with Cygwin Perl or somesuch so that you can get CPAN.pm working.

Oh, and there's also the small matter of Perl not being included in the operating system. Windows is, as far as I am aware, the *only* major operating system remaining that *doesn't* include perl out of the box.


"In adjectives, with the addition of inflectional endings, a changeable long vowel (Qamets or Tsere) in an open, propretonic syllable will reduce to Vocal Shewa. This type of change occurs when the open, pretonic syllable of the masculine singular adjective becomes propretonic with the addition of inflectional endings."  — Pratico & Van Pelt, BBHG, p68

In reply to Re: porting a script to windows by jonadab
in thread porting a script to windows by s_gaurav1091

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.