ActivePerl faq1 - Availability and Installation

ActivePerl FAQ

- NAME
- DESCRIPTION
  - What is Perl?
  - Where can I get tons of information about Perl?
  - Where can I get the ActivePerl interpreter?
  - What do I get with ActivePerl?
  - How do I install ActivePerl?
  - How can I customize my installation of ActivePerl?
  - How do I uninstall ActivePerl?
  - What is ActiveX Scripting?
  - Is there an ActiveX Scripting version of Perl available?
  - When I double-click the perl.exe icon in Explorer, I get
  - How can I get Perl to run a Perl script at the 4DOS command line by
  - Can I build perl from the source code?
- AUTHOR AND COPYRIGHT

# 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:

- http://www.ActiveState.com - The ActivePerl Home Page.

- http://www.perl.com - The Perl home page.

- http://language.perl.com - The Perl language home page.

- http://www.yahoo.com/Computers_and_Internet/Programming_Languages/Perl/ - The Yahoo Perl page.

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