PerlWiz - First Steps

Click here for the perlwiz.biz documentation home page
Contents Prior Page Next Page

This page covers the basics that you need to know to get going with PerlWiz.

Launching PerlWiz

To start the PerlWiz application, you can double-click on the desktop icon (if you did not disable this option when installing PerlWiz):-

Alternatively, click on the Start menu at the bottom-left hand side of the Windows Desktop, followed by the Programs menu, followed by (typically) the PerlWiz programs folder, followed by the PerlWiz program icon.

Alternatively, if you chose to allow Perl programs to be associated with PerlWiz, you can double-click any single Perl program (ending with .pl, .cgi or .pm) from within Windows explorer to launch the default project, and add the selected program to the project. This effectively opens the program file using PerlWiz to enable you to view it, edit it, syntax check it, or execute it.

If you have not yet registered PerlWiz, you will see a notice when you first start (and terminate) the program reminding you of how long you have left to register the program within the trial period of 30 days - see picture for an example. This notice is not displayed on registered versions of the program. Click here if you wish to find out how to register PerlWiz, and the associated benefits of doing this.

Screen Layout

When you first start the application, you should see a nearly-clear editor screen as follows:-

This screen is split into various parts:-

Your First Program

When you have launched PerlWiz, the editor window shows a single comment line known as the shebang (or shell-bang) line, which tells the shell where to find the Perl Tool set when using Perl with Unix or Linux (which will probably be the case on your ISP's web server).  It is important to keep this in your program for when you upload your program to the server on which the program is to be run.  On Unix systems, it tells the shell where to look for the application that will execute the Perl script.

#!/usr/local/bin/perl

When a new file is created, this shebang line will be given automatically as a starting point. This is generated from the 'new' Code Template, discussed later.

We will add to this line to create our first program, which is a simple 'Hello world' program.

Type into the text box the following line of text:-

print "Hello World.;

This will make the entire program:-

#!/usr/local/bin/perl

print "Hello World.;

Syntax Checking & Error Messages

Do a syntax check on the program by doing one of the following:-

This invokes the ActivePerl program in Syntax Check mode, which will look throughout the program and ensure it complies with the Perl language structure. If it does, then a message saying Syntax OK is displayed in the green messages box at the bottom of the screen.

In this case, a deliberate mistake has been introduced, and as a consequence, the following error message is displayed in the green messages box:-

Can't find string terminator "" anywhere before EOF at line 2.

Double-click on this error message to move the cursor to line 2 (if it is not already there).

The problem is that there is no closing double-quote at the end of the Hello World message. We need to insert this (highlighted in yellow) to make the second line look this:-

print "Hello World.";

Do this now, and syntax check the program again. The message in the green box should now say:-

Syntax OK

You are ready to try executing (running) the program.

View Text Output

To try the program and see the results as text output (with any errors going to the green area at the bottom of the screen), do one of the following:-

A text box is displayed with a light-yellow background, which shows the output of the program - which is, in this case the words Hello World.

If you wish to see the program again, click on the Source tab to the left of the text output window.

View Browser Output

To try the program and see the results as browser output (with any errors going to the green area at the bottom of the screen), do one of the following:-

A browser instance is displayed showing the output of the program - which is, in this case the words Hello World.

If you wish to see the program again, click on the Source tab to the left of the text output window.

Saving the program

The program is automatically saved when you try to syntax check or execute the program to text or browser output.

If the program file is called <tempn> where n is any number, then the file is a temporary file, which means that it held in a temporary area, and can be overwritten if it is closed, or if another project uses the file. Temporary files can be included in projects, and are typically  used for trying things out without committing to including the file as a program to be part of an application.  Temporary files are created by Clicking on File and New. They are turned into proper files by using the File / Save As... option or alternatively by holding down the Ctrl key and pressing S to save the file to a proper filename (note that once the file has been saved properly, Ctrl+S will save any changes to the same file name).

In our example, we will save the file in the Projects directory:-

The name on the folder tab for the file has changed from <temp1> to hello_world.pl

If you now look at the filename on the toolbar, it should look like this:-

Closing PerlWiz

To close the PerlWiz application, do one of the following:-

If you have any unsaved files, then you will be asked if you wish to save each of them. If you choose Cancel in response to any of these dialog boxes, then the program will not exit.

Note that if you are using the Default project, then any changes to the project will be automatically saved without any user intervention.

Note that when you re-open the program again, any files open when you last quit the program, will be re-opened automatically for your convenience.

 

(c) Copyright 2003-4 Arctan Computer Ventures Ltd.   All Rights Reserved.
If you have any issues regarding this on-line help, please contact the author by clicking here.
Alternatively, you can leave a voice message on +44(0)7050-618-297 or fax on +44(0)7050-618-298

This Page was last updated: 27 June 2004 05:48