h i p   c o m m u n i c a t i o n s   i n c .

Windows Perl for Win32 FAQ


This faq deals with issues relating to Perl for Win32. The sections are:

INSTALLING
  1. Where do I get Perl for Win32?
  2. How do I install Perl for Win32?
BEGINNER
  1. How do I run a perl script?
  2. How do I get on the mailing list?
  3. Where can I get more information on NT Perl?
  4. Is there an archive of this list?
  5. How do I make my perl script executable from the command line.
  6. why doesn't the Unix #! notation work with my perl script on Windows NT
  7. Why do I get a failure when install.bat is looking for ctime.pl?
BUGS
  1. How do I tell if a bug is specific to the NT port?
  2. How do I report a bug?
ADVANCED
  1. Why can't I get web forms / CGI to work with NT Perl?
  2. Why isn't dynamic loading supported?
  3. Why isn't function [insert Unix system call of choice] available in NT Perl?
  4. Why can't I treat sockets as filehandles?
  5. What do I need to compile the source code?
  6. What happened to DBM support?
  7. Why does the install script behave the way it does?
  8. How does the OLE Automation stuff work?
  9. How do I work with embedded objects?
  10. How do I use NT Registry Extensions?
  11. Is there a way to print to std out in binary mode?
  12. Does anyone know how to grab the system date and time in a perl script?
  13. Does ntperl have the data base extensions as perl does in UNIX?
  14. How do I make files on a Unix box available to NT?
  15. What's in store for the future?

WEB RELATED
  1. When I am running perl as a cgi-script, what is the working directory?
  2. Can I successfully get HTML files through HTTP protocol with NT Perl scripts?
  3. Is it possible to get https (EMWAC) to run a perl script?
  4. How do I run my perl script as a cgi-script?

ANSWERS:


INSTALLING

  1. Where do I get Perl for Win32?

    Perl for Win32 can be retrieved via anonymous ftp from our FTP site. MIPS,Alpha, PowerPC, i86 binaries are available.
  2. How do I install Perl for Win32?

    There is an install.txt file included with the distribution. It explains the ardous process. ( you run install.bat and answer yes twice. ). PS: make sure that you unzip the file with the option to preserve the directory structure.

BEGINNER

  1. How do I run a perl script

    Perl is an interpreted language. The script is compiled each time you run it. This may seem like a curse, but it allows perl to do things that compiled languages cannot.
    To run a script
    1. save it as a text file (usually with a .pl extension) for ex: myscript.pl
    2. run it:
      perl myscript.pl
      NOTE: perl.exe must be in your PATH.

  2. How do I get on the mailing list?

    There are two available mailing lists currently for NTPerl.
  3. Where can I get more information on NT Perl?

    Check out Hip's NTPerl5 Web Page.There is online documentation re: Unsupported functions, OLE, man pages and NT specific extensions ( registry, eventlog etc ).
  4. Is there an archive of this list?

    There will be an archive available via web soon, watch the ntperl mailing list for updates.
  5. How do I make my perl script executable from the command line.

    NT does not recognize the Unix #! convention. packaged with NT Perl is a utitlity PL2BAT, that will package a perl script inside a .bat file.
  6. why doesn't the Unix #! notation work with my perl script on NT

    NT doesn't support this notation. see above.
  7. Why do I get a failure when install.bat is looking for ctime.pl?

    When you unzipped the perl archive, you didn't use the option to preserve the directory structure. Do this and all will be well!

BUGS

  1. How do I tell if a bug is specific to the NT port?

    Before reporting a bug, first look at the documentation available at Hip Communications. Specifically, the UNIX functions that are not supported by NTPerl. If the problem you are having is related to an NT specific call, then it is quite possible you have encountered a real bug ( or feature ).
  2. How do I report a bug?

    You can report a bughere.

ADVANCED

  1. Why can't I get web forms / CGI to work with NT Perl?

    This could be a problem with how your web server is setup.
  2. Why isn't dynamic loading supported?

    Dynamic loading is supported as of Perl5 Release 100 beta 1.
  3. Why isn't function [insert Unix system call of choice] available in NT Perl?

    Some functions, due to operatins systems differences between NT and Unix have not been supported in ntperl. See the documentation about unsupported functions in http://info.hip.com/ntperl
  4. Why can't I treat sockets as filehandles?

    Releases since build 090 allow you to use sockets as filehandles,if you compiled the source with USE_SOCKETS_AS_HANDLES defined.
  5. What do I need to compile the source code?

    You need a win32 compiler ( such as MSVC2.0 or the Win32 SDK ). The makefiles require nmake to build the tree.
  6. What happened to DBM support?

  7. How does the OLE Automation stuff work?

    see the documentation at http://info.hip.com/ntperl and read about the extensions in the documentation section.
  8. How do I work with embedded objects?

  9. How do I use NT Registry Extensions?

    The registry extensions documentation comes with the distribution in the docs directory.
  10. Is there a way to print to std out in binary mode?

    The following will work: binmode( STDOUT );
  11. Does anyone know how to grab the system date and time in a perl script?

    ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime( time );
  12. Does ntperl have the data base extensions as perl does in UNIX?

    Here is an excerpt of the response from the mailing list: Funny you should ask. I just released a preliminary distribution of a freeware toolkit which lets you interact with ODBC data sources from ntperl 5. While the target is CGI development, you could probably do lots of other fun stuff with it (may make up for a lack of sybperl on nt). Anyhow, it's on: ftp://ftp.digex.net/pub/access/psii/iodbc.zip which always points to the latest version. It includes: iodbc beta 2, Lee Fesperman's 32-bit command line ODBC tool html.pm, a perl module for building pages in an OO fashion iodbc.pm, a perl module which encapsulates iodbc queries sql.pl, a perl script for allowing embedded SQL within HTML docs Hope this helps, Brian Jepson (bjepson@conan.ids.net) Director of Advanced Technology, Prosoft Systems International, Inc.
  13. How do I make files on a Unix box available to NT?

    Try the Unix daemon SAMBA: ftp://nimbus.anu.edu.au is one source for the code
  14. What's in store for the future?

WEB STUFF

  1. When I am running perl as a cgi-script, what is the working directory?

    This depends on the webserver.In some cases it is the working directory of the WebServer, in others it is the location of the perl script. The easiest way to check, is to run the following code as a cgi script
    	
    	use Cwd;
    	$my_dir=cwd;
    	print "my working directory is $my_dir\n";
    	
  2. Can I successfully get HTML files through HTTP protocol with NT Perl scripts?

    Yes, Perl supports TCP/IP socket calls.Check out the examples distributed with the source.
  3. Is it possible to get https (EMWAC) to run a perl script?

    EMWAC and NT Perl5 work just fine together. Emwac handles CGI scripts in a slightly different way than most Web servers, however. When you specify the URL for a perl script, you need to specify the perl5 program, and the path to your perl script relative to your http document directory. For example: http://www.foo.com/cgi-bin/perl.exe?cgi-bin/archie.pl On the Netscape NT server, this would be http://www.foo.com/cgi-bin/perl.exe?archie.pl This would run the archie.pl script in your /https/cgi-bin/archie.pl directory, assuming that perl.exe is also in your cgi-bin directory. Thanks to John Buckman for this answer. Walter Shelby Group Ltd. - Internet Software Publishers
  4. How do I run my perl script as a cgi-script?

    This depends on the web server you are using. First RTFAQ for your server. The common methods are: Set up an association between the .pl extension and perl.exe ( in the web server if it supports it), then reference the script with it URL. OR use the perl executable in the URL with the script as an arguement. ex: http://www.there.com/cgi-bin/perl.exe?myscript.pl. People should be aware of the security concerns in this last case.