Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Perl on Windows 2000

by nimdokk (Vicar)
on Jul 22, 2003 at 12:32 UTC ( #276692=perlquestion: print w/replies, xml ) Need Help??

nimdokk has asked for the wisdom of the Perl Monks concerning the following question:

Greetings,
I may have a need to port some Perl that has been developed on a *nix system to Windows 2000. I know already that some of the code will definitly need to be changed and some will have to be removed completely because the functionality of the routines in question is not available on the Windows platform. I have never worked with Perl in the Windows environment, are there any points that I might need to watch out for. The code I'm looking to port consists of a homegrown module and a bare template that we use as the base for the scripts we need to create. I'm basically just looking for suggestions or advice in dealing with Perl on Windows.

Thanks.


"Ex libris un peut de tout"

Replies are listed 'Best First'.
Re: Perl on Windows 2000
by moxliukas (Curate) on Jul 22, 2003 at 12:47 UTC

    Most of the specific Perl issues on cross-platform development are mentioned in perlport manual. You should also look for bits and pieces of shell code that is very usually hardcoded into perl scripts under Unix systems.

    I'd say the major differences are path separators, handling of binary data in files and use of external shell utilities.

      And don't forget the accursed differences in the way even the NT command line interpreter ("shell" in Unix-speak) does(n't do) globbing with the examples of "one-liner" scripts.

      If you don't know what I'm talking about, try

      perl -pi.bak -e "s/UNIX/Windows/" *.txt
      on Unix and any flavour of Windows.

      OK, maybe that's not so helpful, but it bothers me so much =)

      If not P, what? Q maybe?
      "Sidney Morgenbesser"

      Thanks, I'd forgotten about that.


      "Ex libris un peut de tout"
Re: Perl on Windows 2000
by nite_man (Deacon) on Jul 22, 2003 at 13:31 UTC
Re: Perl on Windows 2000
by WhiteBird (Hermit) on Jul 22, 2003 at 12:54 UTC
    • I prefer using ActiveState on Windows.
    • Install modules using ppm (Perl Package Manager) whenever possible
    • Check out the Win32 extensions and learn how to use them. (Dave Roth has a great book and a website that is most helpful)

      I agree here, I have had great results with ActiveState on both Windows 2000 and Windows XP. Perhaps the best thing about it is ppm, which is great. Installing modules is so easy with ppm, you just run it, it gets it, it installs it. That simple most of the time.

Re: Perl on Windows 2000
by flounder99 (Friar) on Jul 22, 2003 at 15:57 UTC
    Everyone else has given you some great sources of information. I just wanted to give you a few practial gotchas I've run into.
    • Forgetting binmode on binary files on windows. Get in the habit of using binmode on binary files even on *nix
    • Using backslashes in paths (when porting from windows to *nix) forward slashes work fine on windows but some windows-only developers (read VB) tend to use backslashes
    • Globbing (or the lack of on windows) in the command line. Windows shell will hand you "*.txt" from the command line.
    • File permission problems (when porting a program from a VB programmer who does not understand them to *nix)
    • Problems on windows when trying to open filehandles to/from pipes. Again it is a limitation of the windows shells

    --

    flounder

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://276692]
Approved by Skeeve
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2020-07-02 09:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?