Perl Builder Frequently Asked Questions

General/Common Problems

I'm new to Perl/CGI. What's the best way to get started?

Can I open multiple files in Perl Builder?

The "View in Browser" button does not start my browser. What should I do?

The Perl Documentation (Local) command under the Help menu does not work. What should I do?

What's the difference between the Professional and Standard Versions? How can I upgrade?

Where should I send feedback/suggestions/bug reports?

Debugging

Why doesn't Perl Builder step into a routine in another module or library?

What do I do if my Perl program gets caught in an infinite loop?

How can I "Dump" the contents of a complex/nested data structure?

I don't like having to switch to the Output tab to view the output from my script. Is there an alternative?

How do I set command line arguments/parameters for my Perl script?

Can I change the keyboard mapping for the debug commands to match Visual C++, Visual Basic, etc.

How can I test a CGI script which uses URL encoding like "myscript.cgi?f1=hello&f2=goodbye&" instead of a form?

Is there a way to "step out" of a subroutine?

Is there a way to set or examine values for $ENV environment variables?

Is there a way for me to add code which will execute only if my script is running within Perl Builder?

I am getting a compiler error in Perl Builder, but not when I run from the command line. What should I do?

Using the Editor

Can Perl Builder automatically fix all the indentation in my script?

Can I use my favorite text editor with Perl Builder?

Can I display/remove line numbers in the editor?

Can I search for (or check for the presence of) a matching bracket, brace or parenthesis?

Is there a way to "comment out" multiple lines/shift multiple lines left or right?

Problems after the Script is moved to the Web Server

My Script works in Perl Builder, but not after I put in on my server.

Email is not working on my NT server


Where should I send feedback/suggestions/bug reports?

Please send email to perl@solutionsoft.com.


Can I open multiple files in Perl Builder?

Yes! The professional version allows you to open multiple main scripts and then select the one that you want to be active for debugging. Please see Opening Activating Scripts in the Professional Version for details.

The Standard version allows only one main script to be open, but you can still open other files.

To open multiple files in the Standard Version., you need to use the Open Module/Library command under the File menu.  Although this command will often be used to open and debug a module or library associated with your script, you can also open other files (such as unrelated scripts or text files) using this command.

In the Standard version you cannot open multiple files using the Open Script command. This command opens a new main script. A main script in Perl Builder acts like a project or workspace in other development tools and is always displayed in the leftmost tab.

When you open files using the Open Module/Library command, Perl Builder will keep track of them for you. You can then use the View Module List command under the File menu to display a list of these files so you can quickly reopen them.

Don't leave extra files open in the IDE if you are not actively using them because this can slow down the debugging commands.

For more on multiple file support, please see Working with Multiple Files in the Perl Builder online help.


What do I do if my Perl program gets caught in an infinite loop?

Press the Stop/Reset Button. This will terminate your script and reset the debugger.

You can also press the Pause button. This will generally stop your script and then allow you to continue from the same point--provided that a breakable line is available within the loop. The Pause button may not be 100% reliable in all cases, in which case, you will need to use the Stop/Reset button.


How do I set command line arguments/parameters for my Perl script?

From the Run/Debug menu, choose Set Command Line Arguments.


Can I display/remove line numbers in the editor?

Yes, choose Editor Options and Colors from the Tools menu and then click the Options tab. You can control line number both on the screen and while printing.


Can I change the keyboard mapping for the debug commands to match Visual C++, Visual Basic, etc.

Yes, choose Options from the Tools menu and then click the Preferences tab. Select the mapping scheme you want from the drop down list.


Can I have Perl Builder select the entire line when I click in the left margin?

Yes, choose Options from the Tools menu and then click the Preferences tab.  Select the proper Left Margin Behavior radio button.


Can I search for (or check for the presence of) a matching bracket, brace or parenthesis?

Yes. Put the cursor right before a bracket and  press either Cntr-[ or Cntrl-]. Perl Builder will select the matching bracket, if there is one. This features works with any of the four types of brackets: (), {}, [], <>.

The Professional Version also offers "mouse-over" bracket matching. Just hold the mouse over a bracket { } and Perl Builder will highlight the bracket and its partner.


Is there a way to "step out" of a subroutine?

There is no "step out" command. However, you can accomplish the same thing with the Run to Cursor feature. Click on the line just after the subroutine call. Then right click and choose Run to Cursor from the context menu.


Why doesn't Perl Builder step into a routine in another module or library?

If you have difficulty stepping into (or stopping at a breakpoint within) a module or library, please check the following:

The module or library must be open in the IDE before you start debugging. Perl Builder will not open the file automatically. Note that the subroutine will still be executed whether the module is open or not. However, if you want to step into it with the debugging commands, it must be open in the IDE.

Debugging must be enabled for the module. If the module has a standard Perl extension, such as .pl, .pm, etc, debugging will be enabled by default. If you are using another extension, you will need to enable debugging by opening the Module list and checking the box for the file at the bottom of the window. To open the Module List, choose View Module List from the File menu.

If you are using a "require" statement, you cannot specify a path. Use the syntax "require 'libfile.pl' ; "and place the libfile.pl file in the same directory as your script.

If you are using something like, "use xxx::yyy", Perl Builder will support up to 3 levels. You will not be able to step into something like "www::xxxx::yyyy::zzz".

Modules and their locations must be specified in your code with constructs such as "use" "require", "uselib", etc. Perl Builder does not support using command line switches for this.

If any of the above require you to modify your code, you can use the $::PERLBUILDER flag to determine whether you are running in Perl Builder and execute different code accordingly.


Is there a way to set or examine values for $ENV environment variables?

Yes, use the Evaluate/Modify command just as you would for any other variable. Note that Perl Builder's CGI simulation feature uses the GET method and sets the QUERY_STRING environment parameter based on your form inputs.

The PATH_INFO variable can be set using the Set Command Line Arguments command under the Run/Debug menu.

If you need to set up a number of Environment variables each time your script is run, you can use the $::PERLBUILDER flag to add code to do this:

if ($::PERLBUILDER) {	#if we are running in PB, set up ENV variables...

$ENV{'whatever'} = "new value" ;

}


The "View in Browser" button does not start my browser. What should I do?

Try starting your browser first. Then leave it running and click the View button.

If your browser will not start, leave it running while using Perl Builder and minimize it to the taskbar rather than shutting it down.

Also, you may wish to try re-installing your browser. Perl Builder uses the standard Windows shortcut method to launch the browser, so if it doesn't start, it may indicate a problem with the browser installation.

Note that Perl Builder supports only Internet Explorer and Netscape. Other browsers may not work.


Is there a way for me to add code which will execute only if my script is running within Perl Builder?

Yes, you can use the $::PERLBUILDER environment flag. This is set to "1" if your script is running within Perl Builder.

You can use this flag to add code to set environment variables, set paths which are different on the server vs. your local drive, etc.

if ($::PERLBUILDER) {	#if we are running in PB, set up ENV variables...

$ENV{'whatever'} = "new value" ;

}


Can I use my favorite text editor with Perl Builder?

Yes. Perl Builder includes features which allow you to synchronize an external editor with the Perl Builder IDE.

To set this up:

1	Choose Options from the Tools menu and click the Locations tab.

2	Set the path to your external editor. You can click the Browse button at the lower right of the dialog box and then use the Open dialog box to find the .exe file for your editor.

3	Check the "Automatically Load Modified Files on Activation" and "Automatically Save Modified Files before Deactivating" boxes if you want to take advantage of these features. For maximum synchronization with an external editor, check both of these boxes.

4	Click OK. You will see a new icon on the far right of the Perl Builder toolbar. You can click this icon to open the current file in your text editor.

For more details on this, see Using an External Text Editor with Perl Builder in the online help.


Is there a way to "comment out" multiple lines/shift multiple lines left or right?

Yes, these command are available on the toolbar and under the Edit menu. There are also hotkeys which are shown when you drop down the Edit menu.


How can I test a CGI script which uses URL encoding like "myscript.cgi?f1=hello&f2=goodbye&" instead of a form?

Select "Set Command Line Arguments" from the Run/Debug menu and then fill in the PATH_INFO box. You should enter everything that comes after the "?".

The information you enter will be passed to your CGI script in the $ENV{'PATH_INFO'} variable. If you have not selected a form in the Input Values tab, then the information will also be available in the $ENV{QUERY_STRING'} variable. The method will be set to "GET".


The Perl Documentation (Local) command under the Help menu does not work. What should I do?

You must have the Perl documentation on your computer for this command to work. The documentation is not included with Perl Builder.

You can set the location of the documentation in the Tools | Options dialog box, Locations tab.

Documentation in HTML Format is included with the latest versions of Perl from ActiveState and is installed in the "html" subdirectory under the main Perl directory. Set the location in Tools | Options to point to the index.html file in this directory.


I'm new to Perl/CGI. What's the best way to get started?

Read the Perl Builder Getting Started manual. This has lots of information which is geared toward novices/non-programmers. You can access this under the Help menu. The document can be viewed and/or printed in Microsoft Word or WordPad.

Complete the Perl Builder Tutorial. This is available under the Help menu.

Visit our Perl Resources page at http://www.solutionsoft.com/perl_resources.htm. This page has links to tutorials, FAQs, Newsgroups, books and other resources that will help you learn Perl.

Get a good book on Perl programming. There are some recommended books on our resources web page (above).


I don't like having to switch to the Output tab to view the output from my script. Is there an alternative?

Yes, from the Run/Debug menu, choose Show Interactive I/O Window.

A floating window will appear. You can resize/move the window as you wish. Your output will be displayed here.

If you have an interactive script which waits for user input, you can also enter the input in this window.


How can I "Dump" the contents of a complex/nested data structure?

Use the Evaluate/Modify command from the pop-up context menu or the Run/Debug menu. Enter the expression you want to dump. Then click the Dump button.

This feature uses Perl's Data::Dumper module. This module was not included in some older Perl distributions, so it this feature does not work for you, you may need to download the latest version of Perl.


Email is not working on my NT server

Perl Builder is set up to assume a Unix webserver using Sendmail. If you are using an NT server, your script will still run, but the email probably will not be sent correctly. Unlike Unix, where Sendmail is the standard for email, NT has a variety of email applications.

To get things working on NT, you will need to obtain a working Perl script which sends email on your server. Use this script as a guideline to modify the code generated by Perl Builder.


Can Perl Builder automatically fix all the indentation in my script?

Perl Builder includes two editor scripts to do this. The first script was written internally and uses tabs to format the indention. You can run this script by choosing Fix Indentation from the Editor scripts menu. You must select the entire script (or the portion that you want to fix the indentation on) first.

The second script, Fixindent2.pl is a revision of our original script by John Weaver. This update uses spaces instead of tabs, disregards brackets in comments, and indents HTML embedded within the script. To run this script, choose Script Manager from the Editor Scripts menu. Then select FixIndent2.pl and click Run. Again, you have to select your entire script before doing this.

Neither of these scripts is guaranteed to give good results in all situations. You can try both and compare the results. We recommend you save your script before trying these; however, you can use the undo command to reverse the operation.


What's the difference between the Professional and Standard Versions?
What's the difference between the Professional and Standard Versions? How can I upgrade?

A comparison table is available here.

Detailed information on the Professional Version features is available here.

Registered users of Perl Builder 2.0 Standard can upgrade to the Professional version by paying the current price difference between the two versions, plus shipping (the professional version ships on CD-ROM). Please contact our order desk at 1-888-765-6738.