[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cgi-list
Subject:    Re: [CGI] Perl/CGI from Unix to W'NT
From:       Jonathan Peterson <jon () amxstudios ! com>
Date:       1998-06-30 12:17:25
[Download RAW message or body]

At 12:53 PM 6/30/98 +0200, Thomas Loeffler wrote:
>Dear Perl/CGIians,
>
>I'm interested in your experiences with Perl/CGI script transfers from Unix
>to Windows NT. What are the differences in Perl/CGI scripting between Unix
>and Windows NT? Is it possible to make automatically (e.g. with a
>translator or an additional library on the Windows side etc.) all necessary
>changes in a script which works under Unix in order to get it run under
>Windows NT? Etc.?

There are two issues here. One the one hand Perl, on the other CGI. If you
are planning to use IIS as your webserver, using CGI is an uphill battle.
IIS support for CGI is quirky, difficult, and an uphill struggle. If you
are using O'Reilly or Netscape then the situation is much better. IIS
_REALLY_ wants you to use ISAPI (or better still, ASP), not CGI. Microsoft,
as far as I can see considers CGI to be a legacy protocol and supports it
only for backward compatibility.

On the other hand, I've always been pleasantly surprised at how portable
Perl is accross *nix/NT. Most scripts that don't access the filesystem will
port straight accross. Sockets support is now fine. The obvious pain is the
backslashes in paths that NT uses. There _is_ an elegant way to write
portable code in this respect, but I can't remember it - anyone? I advise
getting the 'official' Win32 binary and NOT the ActiveState port, which is
less stable.

Next up, scripts that use sys, and backticks. While Win32 Perl supports
that functionality, since most of the programs you call that way aren't
normally on the system, it will break. As Perl has matured into a
'programming' language as opposed to a 'scripting' language, some of what
backticks were ideal for is now available in the standard libraries.
File::Find being the one that spring to mind. You may need to do some
re-writing here. Alternatively, many GNU utils will compile happily on
Win32, so you could install such progs as you need to call with backticks.

Compiling CPAN modules may be a bit harder, or very hard if the modules use
xs and C code. Either way, the abscense of things like 'make' on Win32 (by
default, at least) make this a chore. Often it's a case of just moving the
.pm file to the right place, but often it isn't. If you aren't using any
CPAN modules, no problems!

At this point I could go on and on about the deplorable absence of things
like FIFO's, symlinks, and so forth. But I won't.

To summarise:

IIS provides a poor CGI environment, try to use Netscape or O'Reilly
(Apache is not really ready yet, regardless of being out of beta)

Perl, if written with a view to portability will port very easily to Win32.

ActiveState's Win32 Perl, and its PerlScript product, are both rather
unstable.


--------
Jon Peterson   jon@amxstudios.com   London, UK

What if there weren't any hypothetical situations?
				



-----------------------------------------------------------------
For subscription information, http://www.jann.com/lwgate/lwgate.pl/CGI-LIST/.

The CGI Tips & Tricks website (and archive of the list) is located
at http://www.jann.com/Perl/

cgi-list is hosted by Summit Communication Design (http://www.summitdesign.net).
-----------------------------------------------------------------

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic