
PerlWiz
- First Steps
Click here for the perlwiz.biz documentation home 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:-
- The title bar shows the name of the application, followed by the name of
the Project in square brackets. The default project shows this as a
sideways-face. It is also indicated whether this is the default project. The
default project can be used when you wish to try out Perl programs etc., but
do not wish to create a specific project to do so. This is especially
useful when learning the language and trying things out - you can get going
straight away without having to learn too much about the IDE (Integrated
Development Environment - i.e. PerlWiz!)
- The Menu splits access to all of the functionality within PerlWiz into
different options:-
- The File menu gives access to actions on individual files
within the project (Open, Save, Print etc.)
- The Project menu gives access to actions on individual projects
- e.g. Properties
- The Edit menu contains editor-specific actions such as
clipboard options, indenting, capitalization etc.
- The Special menu contains editor-specific actions that are
language-specific - e.g. HTML and Perl actions
- The Search menu contains search and replace options
- The Templates menu contains options for Code Templates -
i.e. snippets of programs
- The Debug menu gives options related to finding errors in your
program, such as syntax checking
- The Do menu gives execution-related options, such as running applications.
These ignore breakpoints
- The Tools menu has any extra tools such as downloading the
latest version of PerlWiz
- The Help menu gives access to the on-line help, 'About'
information, links to web sites, and registration.
- The Toolbar shows various pictorial icons that represent various
common actions that you may wish to gain fast access to whilst working in
Perl. Hover the mouse course over any icon to see a tooltip that explains
the function of the icon.
- You can open multiple files at any one time. These are listed under the
toolbar as folders tabs, with the filename in each tab. If a file has been
modified (i.e. needs saving), it is indicated by a leading asterisk
(*). Click on a folder tab to switch to working with another editor
file.
- The main area of the screen shows the editor. This optionally shows
line numbers (in the grey gutter at the left hand side) together with the
source code being edited. This could be a Perl program, a HTML web
page, or even a simple text file.
- To the left of the editor area are a number of tabs relating to different
views of the information in the editor area:-
- The Params tab lists any form fields or environment variables
that you wish to simulate being passed to the Perl/CGI program. Note
that this tab is only available when editing Perl programs.
- The Text Output tab shows the text output from executing the
Perl program. This is context-highlighted to show any HTML tags if the
Perl program produces web browser-based output. Note that this tab is
only available when editing Perl programs
- The Browser Output tab shows the output from executing the Perl
program as a web page, interpreting any HTML that the Perl program
outputs. It uses the standard browser, typically Microsoft Internet
Explorer. If the text editor is not editing a Perl program, it will
simply show the contents of the text editor interpreted directly by the
browser (e.g. it will render a HTML file directly, or show a text file
as-is). There are a set of controls at the top of the browser that mimic
the operation of a standard browser.
- The light-green area below the editor shows any output messages from
executing or syntax checking Perl programs. If any of the lines show an
error or warning message referring to a specific line number, then
double-clicking on the message will take you to the line on which the error
occurred. Note that this message box can be enlarged or reduced by dragging
the divider between the editor area and the messages area.
- The bottom-most part of the window shows the status bar, unless disabled
in the project options. This is split into five section (from left to
right):-
- Cursor Location (Row and Column positions, where each starts at
number 1). Double-clicking on this part of the toolbar will open
the Go To dialog box to enable you to type in a new line number
on which to place the cursor.
- Modified status. This shows whether the currently selected file
has been modified, and thus needs to be saved (mirrors the visibility of
the asterisk in the currently selected file's folder tab)
- Insert / Overstrike mode. This shows whether typing will insert
characters at the cursor location, or replace characters at the cursor
location. Double-clicking on this part of the toolbar will switch modes,
as will pressing the Insert key on the keyboard.
- File Size. This shows the projected file size based on
the text contents of the selected editor window. This is measured in
kilobytes (1 kilobyte = 1024 characters typed in the editor).
- File Name. This shows the full file-path of the currently
selected file
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:-
- Click on the
button on the
toolbar
- Hold down the Ctrl key and press the F9 key
- Click on the Debug menu and choose the Syntax Check option
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:-
- Click on the
button on the
toolbar
- Click on the Text Output tab to the left of the editor window. Note
that this executes the program only once after the program / parameters have
changed so that you can refer back to the results without re-executing the
program unnecessarily.
- Press the F9 key
- Click on the Do menu and choose the Run (view Text) option
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:-
- Click on the
button on
the toolbar
- Click on the Browser Output tab to the left of the editor window.
Note that this executes the program only once after the program / parameters
have changed so that you can refer back to the results without re-executing
the program unnecessarily. If you look at the text output after looking at
Browser output, this does not re-execute the program.
- Hold down the Shift key and press F9
- Click on the Do menu and choose the Run (view Browser)
option
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:-
- Choose the File menu and the Save As... menu option.
- Next to the Save In: heading at the top of the dialog box, click in
the drop-down box, and change the directory to the Perlwiz\Projects
directory.
- Choose the filename hello_world
- Click on the Save button.
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:-
- Click on the cross (X) at the top-right hand corner of the PerlWiz
application toolbar
- Click on the File menu and click on the Exit option
- Hold down the Alt key and press F4
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-8
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:
01 February 2007 00:45