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

I have to move our *.pl scripts from and unix server to over to win 2000 server. They're all fairly simple scripts, but I'm somewhat new to Perl.

One of the potential problems in switching cgi-bin platforms would be the location of the Perl libraries on the WIN2K machine, and each of the pl scripts do have a few lines containing this:

push(@INC,"/infosrv/ns-home/cgi-bin/"); require("cgi-lib.pl")

with the "cgi-lib.pl" file containing the PERL path info:

#!/usr/local/bin/perl4 -- -*- C -*-

Any other concerns in moving scripts over to win2k from unix?

Replies are listed 'Best First'.
Re: unix to win2k transfer
by idnopheq (Chaplain) on Sep 10, 2001 at 19:36 UTC
    A few key steps off the top of my head are:

    1. Make sure your directory stucture on the W2K server is identical inso far as the web server is concerned. </il>
    2. Check the modules you are using and make certain they exist on your W2K Perl.
    3. Check for external commands that might be called via backticks or system, etc. Those progs may not exist in W2K by default.
    4. Permissions are a pain to translate over. Make them very restrictive during testing and open things up as you go.
    But, the short answer is "not so much", unless you're also changing web servers, say from Apache to IIS (ew!). That's a whole 'nother nest of hornets IMHO, but some well worded Super Searches sould help here. I would also recommend going with ActiveState's perl distribution, if for no other reasons than the wide proliferation of it and the Perl Package Manager.

    HTH
    --
    idnopheq
    Apply yourself to new problems without preparation, develop confidence in your ability to to meet situations as they arrise.

Re: unix to win2k transfer
by Anonymous Monk on Sep 10, 2001 at 19:32 UTC
    You have quite a long road ahead of you. Mainly because it looks like the original scripts are Perl4.

    Hopefully you will drop the push and require and replace them with:

    use lib '/infosrv/ns-home/cgi-bin/'; use cgi-lib;
    but cgi-lib sucks - use CGI or FastCGI . . .but that's beside the point. Why move from *nix in the first place? There can't possibly be a convincing enough reason not to upgrade to the lastest version of Perl, and build mod_perl into an Apache server. I have no problems with Win2000, I just feel that moving web scripts to another platform is silly. They are accessible by all platforms. Hell, run two web servers!

    I wish you luck!

      The person may not have a choice. The Unix server may be running on proprietary hardware that has a non-negligeable annual maintenance fee. Maybe the bean counters thought that was an expense they could cut. Maybe they thought that W2K on commodity hardware would be cheaper in the long run (for some definitions of "cheaper" and "long run" that I doubt coincide with mine).

      It may be too late for the anonymonk to do anything about it. Looks like (s)he's coming from a Netscape environment, not Apache.

      Pointing out how hopeless cgi-lib.pl really is may not do anything, apart from convincing clueless managers that this Perl stuff is pretty whacky, and maybe we better replace it with ASP, or Java, or some other buzzword du jour.

      All I can suggest is to try and help the person resolve the porting issues, and then we'll see about converting them to CGI.pm. How much code are we talking about, anyway?

      --
      g r i n d e r
        only about a dozen or so scripts, most of which will require the same modifications to update to Perl5.

        Thanks!

Re: unix to win2k transfer
by VSarkiss (Monsignor) on Sep 10, 2001 at 20:07 UTC

    You've got some good answers above, but the thing I keep choking on is this line: #!/usr/local/bin/perl4 -- -*- C -*-Can you even obtain Perl4 for Win2K?? I can't find it on Active State's or Indigo Star's web site. Are you planning on compiling it yourself? It may be less work and more benefit in the long run to port to Perl5 and use one of the binary distributions.

    Unless that's just a typo when you did copy-and-paste....

      Thanks for all the responses..very helpful. the unix to win is not my decision.. and yes, these are all Perl4 scripts, but there are only about a dozen which need to be updated to Perl5 on Win2K.