in reply to what is the difference between perl scripting in windows and linux

What are the other differences ?

Perl in Windows cannot fork().
You can only create a new process via one of the Win32 modules.
It cannot link() or symlink().
It can't do anything with symbolically-link files.

Replies are listed 'Best First'.
Re^2: what is the difference between perl scripting in windows and linux
by zentara (Cardinal) on Aug 04, 2010 at 16:34 UTC
    Perl in Windows cannot fork().

    I rarely use windows, and am a linux advocate, but Windows does allow a pseudo fork by creating a thread. The fork command will work on Window's versions of Perl, but there is hidden OS-specific magic.

    The differences which I hassle with the most, is the line endings are different, requiring frequent dos2unix or unix2dos conversions. There is no easy to use IPC on pipes in Windows, so frequently used modules on linux, need special Win32 modules, like IPC::Run instead of the standard IPC::Open3. Also, Windows is done within the confines of a graphical GUI, wheras on linux, there is a true console, so you need to run wperl to suppress windows from opening. Finally, and the BIGGEST problem, there is the hassle of getting precompiled modules for the various versions of win32. Since you don't get an easy to use or install compiler with Windows, you need to rely on others to make many of the modules for you, and often they are hard to find. Wheras on Linux, the instructions to build modules generally work flawlessly.

    To be honest, Perl was designed to run on Linux and Unix platforms, and if you want the most satisfaction from Perl, run it on Linux. Ubuntu is easy and the most Windows-like.... but I prefer Slackware, as it still adheres to the original simple unix style. But if you can't afford 100 hours to learn basic unix, then Ubuntu is great...it has the apt-get program to get you automatic updates, will connect to wireless access points automatically, and is supported for 5 years on each new release.


    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku

      Since you don't get an easy to use or install compiler with Windows

      You are mistaken. There are *three* easy way to install a compiler.

      • Strawberry Perl comes with a compiler.
      • ActivePerl's cpan will automatically install a compiler if needed.
      • You can install MS's compiler for free. It's a one-click install.

      Finally, and the BIGGEST problem, there is the hassle of getting precompiled modules for the various versions of win32.

      Quite the opposite, it's a great plus that you don't need to compile most modules yourself.

        There's also cygwin, which gives you a complete GNU-like environment on Windows, where you can install Perl, bash, gcc, make and all the other familiar tools from the GNU world and easily install CPAN modules and run shell scripts.

        People keep calling me names every time i say that, but i find the cygwin experience much more stable and predictable than ActiveState or Strawberry. Simply put, CPAN module installation fails much more often on these platforms than on cygwin.

        Well ikegami, you use win32 alot, and I respect your opinion. But I still think Perl was designed with gcc in mind. I suppose if you never experienced the ease of "perl Makefile.PL, make, make install" on a module, you might get used to searching various win32 module repositories for binary compatible modules for your win32 system, and consider that easy and clean.

        The OP wanted comparisons, and the above are mine, an old linux dog who won't learn win32 tricks. :-)


        I'm not really a human, but I play one on earth.
        Old Perl Programmer Haiku
        If you're using 32bit windows or a 32bit perl on 64bit windows these compilers will probably work for you.

        Last I checked MS makes the only compiler that will work w/ a 64bit perl for windows.

          if you want the most satisfaction from Perl, run it on Linux

      However, if you're working in a Windows-centric environment, Perl can be useful for management tasks and for interacting with installed programs. Sure there are alternatives (DOS, VBscripts, power shell, etc.), but I often times I prefer Perl.

      Anyways, I'm not trying to pick sides in the Windows vs. *nix debate of which is better. Just wanted to point out that Perl in a predominately Windows environment can still be very useful and provide a lot of satisfaction.

      I think it's best to know how to use multiple tools and grab the one that you think is best for the job. That's my 2 cents.

      Despite what I typed above, I do have to admit that there are a number of built-in Perl functions that whose name/syntax/functionality are more *nix-like, which I admit supports your argument that "Perl was designed to run on Linux and Unix platforms".