New to Perl on Windows. New to programming.

Posted by troyt on 2006-06-27 13:13
OS: Windows | Product: ActivePerl | tags: newbie windows

I've installed ActivePerl. What now?


Go to Start | Run. Enter 'CMD' in the Open field and press Enter. This will open up a DOS command prompt. At the prompt, type:

  C:\>perl -v

You should see version information for ActivePerl.

To evaluate perl code on the command line, you can do this:

  C:\>perl -e "print \"hello world\";"

Note: you must escape double quotes in the code when using -e.

To run a script:

  C:\>perl maintains the defacto standard resources for Perl developers:

What *not* to do:

"PerlScript" is not the same as "Perl script". "PerlScript" is a special version of ActivePerl for certain uses inside IIS servers. If you encounter references to "PerlScript" in the manuals, you can skip them until after you have mastered IIS setup.

PPM is not a Perl Editor. Skip PPM for now, and come back to it when you find you need to add additional features to ActivePerl.

OLE Browser is not a Perl Editor. OLE Browser was just an example of how to do something that isn't a good idea with today's internet. If your version of ActivePerl still has the icon for OLE Browser, you can ignore it and come back to it much, much later.

If you *are* looking for an editor / development environment for Perl, you should try ActiveState's Komodo:

ActiveState Staff
Mon, 2010-06-21 08:10

On Windows, you can double click a Perl file to run it. Don't do this until you know that the file is running correctly, or if you expect it to produce output for you to read. Windows will notice that the Perl script has completed, and will close any running command line screen faster than you can possible read any error message or output. This is just the way Windows works. Start the command line screen before you start running the Perl script if you want to see the output.

On Windows, you can also start Perl by using the Start Menu's "Run" box instead of a command line. This has the same kind of issues that double clicking your Perl script has, so don't use this shortcut until you know for sure that your script does exactly what you expect.