ActiveState!

ActivePerl Documentation
Table of Contents

(Usage Statistics)
(about this ver)


* Getting Started
    * Welcome To ActivePerl
    * Release Notes
    * Readme
    * ActivePerl Change Log
* Install Notes
    * Linux
    * Solaris
    * Windows
* ActivePerl Components
    * Overview
    * PPM
    * Windows Specifics
       * OLE Browser
       * PerlScript
       * Perl for ISAPI
       * PerlEZ
* ActivePerl FAQ
    * Introduction
    * Availability & Install
    * Using PPM
    * Docs & Support
    * Windows Specifics
       * Perl for ISAPI
       * Windows 9X/NT/2000
       * Quirks
       * Web Server Config
       * Web programming
       * Programming
       * Modules & Samples
       * Embedding & Extending
       * Using OLE with Perl
* Windows Scripting
    * Active Server Pages
    * Windows Script Host
    * Windows Script Components

Core Perl Documentation


* perl
* perlfaq
* perltoc
* perlbook

* perlsyn
* perldata
* perlop
* perlreftut
* perldsc
* perllol

* perllexwarn
* perldebug

* perlrun
* perlfunc
* perlopentut
* perlvar
* perlsub
* perlmod
* perlpod

* perlstyle
* perlmodlib
* perlmodinstall
* perltrap
* perlport
* perlsec

* perlref
* perlre
* perlform
* perllocale
* perlunicode

* perlboot
* perltoot
* perltootc
* perlobj
* perlbot
* perltie

* perlipc
* perlnumber
* perlfork
* perlthrtut

* perldiag
* perlfaq1
* perlfaq2
* perlfaq3
* perlfaq4
* perlfaq5
* perlfaq6
* perlfaq7
* perlfaq8
* perlfaq9

* perlcompile

* perlembed
* perlxstut
* perlxs
* perlguts
* perlcall
* perlfilter
* perldbmfilter
* perlapi
* perlintern
* perlapio
* perltodo
* perlhack

* perlhist
* perldelta
* perl5005delta
* perl5004delta

* perlamiga
* perlcygwin
* perldos
* perlhpux
* perlmachten
* perlos2
* perlos390
* perlvms
* perlwin32

Pragmas


* attributes
* attrs
* autouse
* base
* blib
* bytes
* charnames
* constant
* diagnostics
* fields
* filetest
* integer
* less
* lib
* locale
* lwpcook
* open
* ops
* overload
* perllocal
* re
* sigtrap
* strict
* subs
* utf8
* vars
* warnings

Libraries


* ActivePerl
    * DocTools
        * TOC
            * RDF
* AnyDBM_File
* Archive
    * Tar
* AutoLoader
* AutoSplit
* B
    * Asmdata
    * Assembler
    * Bblock
    * Bytecode
    * C
    * CC
    * Debug
    * Deparse
    * Disassembler
    * Lint
    * Showlex
    * Stackobj
    * Terse
    * Xref
* Benchmark
* Bundle
    * LWP
* ByteLoader
* Carp
    * Heavy
* CGI
    * Apache
    * Carp
    * Cookie
    * Fast
    * Pretty
    * Push
    * Switch
* Class
    * Struct
* Compress
    * Zlib
* Config
* CPAN
    * FirstTime
    * Nox
* Cwd
* Data
    * Dumper
* DB
* Devel
    * DProf
    * Peek
    * SelfStubber
* Digest
    * HMAC
    * HMAC_MD5
    * HMAC_SHA1
    * MD2
    * MD5
    * SHA1
* DirHandle
* Dumpvalue
* DynaLoader
* English
* Env
* Errno
* Exporter
    * Heavy
* ExtUtils
    * Command
    * Embed
    * Install
    * Installed
    * Liblist
    * MakeMaker
    * Manifest
    * Miniperl
    * Mkbootstrap
    * Mksymlists
    * MM_Cygwin
    * MM_OS2
    * MM_Unix
    * MM_VMS
    * MM_Win32
    * Packlist
    * testlib
* Fatal
* Fcntl
* File
    * Basename
    * CheckTree
    * Compare
    * Copy
    * CounterFile
    * DosGlob
    * Find
    * Glob
    * Listing
    * Path
    * Spec
        * Functions
        * Mac
        * OS2
        * Unix
        * VMS
        * Win32
    * stat
* FileCache
* FileHandle
* FindBin
* Font
    * AFM
* Getopt
    * Long
    * Std
* HTML
    * AsSubs
    * Element
    * Entities
    * Filter
    * Form
    * FormatPS
    * Formatter
    * FormatText
    * HeadParser
    * LinkExtor
    * Parse
    * Parser
    * TokeParser
    * TreeBuilder
* HTTP
    * Cookies
    * Daemon
    * Date
    * Headers
        * Util
    * Message
    * Negotiate
    * Request
        * Common
    * Response
    * Status
* I18N
    * Collate
* IO
    * Dir
    * File
    * Handle
    * Pipe
    * Poll
    * Seekable
    * Select
    * Socket
        * INET
        * UNIX
* IPC
    * Msg
    * Open2
    * Open3
    * Semaphore
    * SysV
* LWP
    * Debug
    * MediaTypes
    * MemberMixin
    * Protocol
    * RobotUA
    * Simple
    * UserAgent
* Math
    * BigFloat
    * BigInt
    * Complex
    * Trig
* MD5
* MIME
    * Base64
    * QuotedPrint
* NDBM_File
* Net
    * Cmd
    * Config
    * Domain
    * DummyInetd
    * FTP
    * hostent
    * libnetFAQ
    * netent
    * Netrc
    * NNTP
    * PH
    * Ping
    * POP3
    * protoent
    * servent
    * SMTP
    * SNPP
    * Time
* O
* ODBM_File
* Opcode
* Pod
    * Checker
    * Find
    * Html
    * InputObjects
    * Man
    * Parser
    * ParseUtils
    * Plainer
    * Select
    * Text
        * Color
        * Termcap
    * Usage
* POSIX
* PPM
    * SOAPClient
    * SOAPServer
* Safe
* SDBM_File
* Search
    * Dict
* SelectSaver
* SelfLoader
* SHA
* Shell
* SOAP
    * Defs
    * Envelope
    * EnvelopeMaker
    * GenericHashSerializer
    * GenericInputStream
    * GenericScalarSerializer
    * Lite
    * OutputStream
    * Packager
    * Parser
    * Transport
        * HTTP
            * Apache
            * CGI
            * Client
            * Server
        * LOCAL
        * MAILTO
        * POP3
        * TCP
    * TypeMapper
* Socket
* Symbol
* Sys
    * Hostname
    * Syslog
* Term
    * ANSIColor
    * Cap
    * Complete
    * ReadLine
* Test
    * Harness
* Text
    * Abbrev
    * ParseWords
    * Soundex
    * Tabs
    * Wrap
* Thread
    * Queue
    * Semaphore
    * Signal
    * Specific
* Tie
    * Array
    * Handle
    * Hash
    * RefHash
    * Scalar
    * SubstrHash
* Time
    * gmtime
    * Local
    * localtime
    * tm
* UDDI
    * Lite
* UNIVERSAL
* URI
    * data
    * Escape
    * file
    * Heuristic
    * ldap
    * URL
    * WithBase
* User
    * grent
    * pwent
* Win32
    * AuthenticateUser
    * ChangeNotify
    * Clipboard
    * Console
    * Event
    * EventLog
    * File
    * FileSecurity
    * Internet
    * IPC
    * Mutex
    * NetAdmin
    * NetResource
    * ODBC
    * OLE
        * Const
        * Enum
        * NEWS
        * NLS
        * TPJ
        * Variant
    * PerfLib
    * Pipe
    * Process
    * Registry
    * Semaphore
    * Service
    * Sound
    * TieRegistry
* Win32API
    * File
    * Net
    * Registry
* WWW
    * RobotRules
        * AnyDBM_File
* XML
    * Element
    * Parser
        * Expat
    * PPD
    * PPMConfig
    * ValidatingElement
* XSLoader

 ActivePerl FAQ


NAME

ActivePerl faq1 - Availability and Installation


DESCRIPTION

Getting, installing, and using Perl.


What is Perl?

Perl is a scripting language widely used for system administration and programming on the World Wide Web. It originated in the UNIX community and has a strong UNIX slant, but usage on Windows is growing rapidly. ActivePerl is a port of core Perl to Windows.

perl (small 'p') is the program used to interpret the Perl language.


Where can I get tons of information about Perl?

Extensive online documentation is included with Perl itself. You can read the documentation with the perldoc command, as in perldoc document_name. You should start with the perl document and the perlfaq document. For information on other ways of accessing the Perl documentation (including HTML versions of this documentation), see Where can I get documentation on ActivePerl?.

To get more information about Perl, check out these URLs:

There are several good books about Perl. The premier book on ActivePerl is Learning Perl On Win32 Systems By Schwartz, Olson, and Christiansen (O'Reilly & Associates, 1997). This is the Gecko book, and has a picture of a gecko (little chubby lizard with big toes and a smile) on the front cover.

For general perl, two books to consider are Programming Perl, 2nd Edition, by Larry Wall, Tom Christiansen and Randal L. Schwartz (O'Reilly & Associates, 1996) and Learning Perl, by Randal L. Schwartz (O'Reilly & Associates, 1993). These are referred to by Perl enthusiasts as the Camel book and the Llama book, respectively.

If you are new to Perl and there are any terms mentioned in this FAQ that you don't get, try one of the above resources. See the perlbook document that comes with Perl for more information.


Where can I get the ActivePerl interpreter?

ActivePerl is available from the ActiveState home page.

To download ActivePerl from ActiveState, look in this directory:

  http://www.ActiveState.com/ActivePerl

What do I get with ActivePerl?

ActivePerl is a complete, self-installing distribution of Perl based on the standard Perl sources. It is distributed online at the ActiveState site.

"Perl for Win32" generally refers to ActivePerl for Windows.

Perl for Win32 was developed by ActiveState Tool Corporation (originally Hip Communications) for Microsoft Corporation. This effort was undertaken for inclusion in Microsoft's Windows NT Resource Kit.

Since then, ActiveState and various Perl porters have worked to keep ActivePerl current with the standard release of Perl. The oneperl effort, a joint effort between ActiveState, O'Reilly, and various volunteers, has joined the Win32 and standard Perl source code into one common source tree.


How do I install ActivePerl?

Simply double-click the archive you downloaded, and you will be guided through the installation process by the installation wizard. You can select the parts of the Perl package you want installed, and the location you want to install them to.


How do I uninstall ActivePerl?

Go to Add/Remove Programs in the Control Panel, choose ActivePerl from the list box, and click Remove.


What is ActiveX Scripting?

ActiveX Scripting is a Microsoft technology that consists of script engines and script hosts. A script engine, such as PerlScript, VBScript, or JScript, is a programming language that can be embedded in a scripting host, such as Windows Scripting Host, Microsoft Exchange, and Active Server Pages (ASP).


Is there an ActiveX Scripting version of Perl available?

Yes. This is called PerlScript. It is part of ActivePerl, and can be optionally installed during installation.

PerlScript can be used within any ActiveX Scripting Host such as Microsoft Internet Explorer 4.0, Microsoft Exchange, and the Windows Scripting Host.


When I double-click the perl.exe icon in Explorer, I get an empty DOS window with a blinking cursor.

ActivePerl is a command-line program. It expects to be run from the command line, not from Explorer.

If you want to run a Perl script, write the script out using a text editor like Notepad. A good starter program is:

    print "Hello, World!\n";

Save the program to a file (such as C:\temp\hello.pl). Now, start a command prompt window (sometimes erroneously called a DOS window), and type the following line at the command prompt:

    C:\> perl c:\temp\hello.pl

This should print out the words Hello, World! on the screen. You may have to do some fiddling with the PATH environment variable, or specify the full path name to perl.exe, in order for this to work.

perl.exe has a lot of nifty command-line arguments that can make your work easier. See perlrun for details.

To answer the original question about what's happening when you start perl from an Explorer window rather than a command-line window: starting from Explorer is roughly the same as starting perl without any command line arguments. When perl is started without a script file specified on the command line, it expects to receive a Perl program as standard input, i.e., from the keyboard.

The blinking cursor means perl is waiting for your input. You can actually type in a Perl program from the keyboard, and then tell perl to execute it by typing the Ctrl-Z, which is the end-of-file marker on Windows systems.


How can I get Perl to run a Perl script at the 4DOS command line by typing the name of the script without the extension or "perl", just like a regular exe file?

See also How do I associate Perl scripts with perl?.

You can add a line like

    SET .PL=C:\PERL\BIN\PERL.EXE

to your AUTOEXEC.BAT file under Win95/98. You can then type <scriptname> with no extension to run your script, even if you are not in the same directory as the script and the script path is on your path.

Note, however, that this only works with 4DOS, not COMMAND.COM, CMD32.EXE, or CMD.EXE. With those shells you still need to type

    perl scriptname.pl <arg> <arg> <arg>

Can I build perl from the source code?

The Perl source code includes complete instructions on building Perl. You can obtain the latest Perl source from:

    http://www.perl.com/CPAN/src/latest.tar.gz

Once you extract the source, read the README and README.win32 files for instructions on compiling Perl.

You can use the following C compilers to build a native Win32 build of Perl:

Microsoft's Visual C++ (commercial product)

The Microsoft compiler, which includes compilation tools, API and tool documentation, and an integrated development environment.

    http://www.microsoft.com/visualc/
Borland C++ Builder (commercial product)

Borland C++ provides an integrated development environment, compilation tools, and documentation for building Win32 applications.

    http://www.inprise.com/bcppbuilder/
Mingw32 Libraries with GCC or EGCS Compilers (free software)

GCC and EGCS are both high quality freeware compilers that have been ported to the Win32 platform. Together with the freely available Mingw32 libraries, they can be used to build Perl and extensions. They do not provide an integrated development environment, and all of the tools must be run from the command line. The Mingw32 library reuses some of the code developed for Cygwin32 (see below).

EGCS/Mingw32 binaries can be obtained from:

    ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/

GCC/Mingw32 binaries are available at:

    http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/
Cygwin32 (free software)

You can approximate a UNIX development and execution environment on Win32 with the Cygwin32 toolchain. This is a port of numerous GNU tools, and includes an emulation API that provides access to many UNIX features not found on Win32:

    http://www.cygnus.com/misc/gnu-win32

AUTHOR AND COPYRIGHT

This FAQ was originally assembled and maintained by Evangelo Prodromou. It has been revised and updated by Brian Jepson of O'Reilly & Associates, David Grove, David Dmytryshyn and David Sparks of ActiveState.

This FAQ is in the public domain. If you use it, however, please ensure that you give credit to the original authors.

 ActivePerl FAQ