Other RWAP Websites
RWAP
Adventures
Internet Business Angels |
DzSoft Perl Editor is a dedicated editor for creating, editing and testing Perl scripts using a Perl engine, such as Activesoft's ActivePerl. Perl scripts are extremely easy to navigate using this editor. Not only is there a window which shows the scripts, with line numbers listed against each line, but each built-in Perl structure (such as IF, LOCAL etc) is highlighted and remark lines are also faded in blue ink. Perhaps the only thing really missing from this script editor is a reminder of the syntax as you enter the name of each Perl structure. Any subroutines which form part of a Perl script are listed in the main window with a small minimise button at the side of them, allowing you to click on this button and hide the code for that function if you prefer. At the side of the main editing window, is a secondary window (the Code Explorer) which lists all sub-routines and variables contained in the current Perl script. Double clicking on a variable name, lists all the line numbers on which that variable appears and you can then use the mouse to move to the appropriate line number in the main editing window. This is an extremely fast method of navigating a Perl script and also spotting spelling mistakes. Unfortunately, the Code Explorer needs some more work to improve its usefulness:
All of the usual file commands are there to enable you to load and save files, or backup files (and reload from a backup). A list of the most recently opened files is maintained, allowing you to reopen them. A slightly different approach is taken when opening new files to any other items of software that we have used, in that if you Open a new file, it overwrites the existing one, unless you specify that it is to be Opened in a New Window. You are even able to specify that line ending formats should be in Windows, Unix or Mac form. Other file options include the ability to upload to ftp (provided you have an open internet connection) and export the Perl script as a HTML file - ideal for adding to a website for users to view (and possibly navigate). On the ftp option, you are asked to enter the ftp details (which can be stored as a profile for future use) and the remote and local file names. Not as easy to use as a program such as WS_FTP, but nonetheless, an excellent little utility. There are a wide range of editing commands provided to help you to enter scripts. As well as the standard Undo, Redo, Copy and Paste commands, there are also commands to Select the whole Perl script, Copy the whole Perl script to the clipboard and Copy the current line. Once you have highlighted part of a line, there are also commands to turn the highlighted section into a Comment (or remove the comment from the start of the section), change the case of the highlighted section, or to switch the highlighted section to and from URL encoding (an ASCII list). All of this, coupled with a set of fairly powerful search and replace commands make editing the script as easy as possible. As an added bonus for people used to WinPerl, you can actually see any highlighting (yes, at last!!). Navigation of a Perl Script is also made easier by use of the Code Explorer (see above), Go to Line Number commands, and support for up to 10 bookmarks in the script. Perhaps the only real oversight here is the ability to double click on a sub-routine name in the script and be placed on that sub-routine, either in the current Perl script, or any linked library files. There are further very useful features to assist with creating a script quickly and easily, one of the most important of which is "Quick Insert". Quick Insert allows you to store small snippets of code which can then be automatically inserted into a Perl script by clicking on one of the available items in the list. The editor is shipped with snippets which contain code for structures (such as if, and foreach), fetching parameters from forms and printing a HTML document. It is easy to change each code snippet to suit your own personal tastes and this can ensure that you do not forget how to write Perl code to perform certain tasks, such as writing an email. Having entered a Perl script, before uploading it to a server, you have various options. Perhaps the most important one to start with is to check the syntax of the file. This is simple and spots up most errors, although, as with WinPerl, due to the structure of the language, errors can be reported a few lines below where the actual code has been typed incorrectly (such as a missing end of line marker). It is a pity this is not configurable, as it would be nice to enable warnings where the same variable name has been used but with different case, and possibly where variable names are only used once (this is invariably due to a misspelling). However, the warnings generated tend to be clear and allow you to double click on them to move to the line which has caused the warning.. Having checked the syntax, you can then run the Perl script on your local computer to check whether any errors or warnings are generated. DzSoft's Perl Editor allows for three different Run options, Run, Quick Run and Run in Command Prompt (a DOS Window where available). The Quick Run command simply runs the script as it stands, producing any warnings or errors thrown up by ActivePerl (or other Perl interpreter). On the other hand, Run opens a configuration window before calling the Perl interpreter. This allows you to set-up environment variables, enable tainting (security) checks, affect which warnings are displayed, and even pass input data to the Perl script, as if it had been called using a GET or POST command from a web site. This allows comprehensive checking of a Perl script before it is let loose on a server and is highly recommended. The final option, Run in command prompt, opens a DOS window to run the Perl interpreter, allowing you to pass any switches supported by the interpreter and arguments - this is designed to test Perl scripts which will are not designed to be run in a Windows or internet environment (CGI scripts). The only shortfall of this range of commands to test the Perl script, is that the file is not automatically saved to disk before it is Run (especially when a Perl script can fall into an infinite loop - see below). When this did happen however, we were luckily able to track down a file in the Windows/temp sub-directory, which contained our original script plus additions to some lines to generate the information for the breakpoints. Of course, the main asset to being able to run a Perl script on a local machine is being able to set breakpoints. Although it is easy under DzSoft's Perl Editor to set or clear a breakpoint, we found a slight problem, in that when the Perl Interpreter reaches the breakpoint a window is opened listing all variables and their current values as well as allowing you to Continue or Abort Execution. Abort actually fails to abort the Perl interpreter - it appears to continue to run the script, but just prevent any output being generated by the program. All further breakpoints continue to have effect. This was found to be a big problem when testing a program which entered an infinite loop - there was no way of breaking out of the Perl script without forcing Windows to close the Perl Editor with <ALT><CTRL><DELETE>. We would also suggest that a keystroke should be implemented which aborts the Perl Interpreter in any event would be of great assistance. The other major shortfall when testing a Perl script is that there is no way of single stepping through the code, other than setting breakpoints on every line. We could also find no way of setting a breakpoint in a library function. Again, as a bonus to people used to the idiosyncrasies of WinPerl, the output window can be scrolled to allow you to view the whole of the output generated by a Perl script (not just the last page). However, some minor faults still remain with the output, in that if the output is a fairly long line, the horizontal scroll bar does not work properly in the Text output window. Despite the few minor problems outlined in our review, we have found this program to be an excellent tool for generating Perl scripts and the best Perl editor on the market. It is certainly one utility that a Perl programmer cannot do without and has to be highly recommended.
|
(Page Last Updated 18/12/03)