The code explorer window has a centralized view of the subroutines, variables and libraries used in your script. Also the results of a perl pattern search and any errors or warnings are viewed here. The code explorer also lists subroutines of the libraries used by the script.





1) Packages in script.

2) Exported elements from the modules used in the script.

3) Uses. Modules used in the script (use ...).

4) Expandable modules used in the script. The node can be expanded to show the subroutines of the module.

5) Requires. Modules required in the script (require ...).

6) Expandable modules required in the script. The node can be expanded to show the subroutines of the module.

7) Expanded module listing its subroutines.

8) Subroutines in the script. See also the sub list.

9) Scalars.

10) Scalar node expanded.

11) Occurrences of a specific scalar in script.  Shows were the scalar is used in the script in any context.

12) Arrays. As above.

13) Hashes. As above.

14) Errors and warnings node.  Displays errors or warnings as you type, and is also updated automatically. Disappears if not errors or warnings are found. See Testing for Errors.

15) POD. Displays header titles of pod documentation.

16) Bookmarks. Displays bookmarks that have been added in scripts using the "Add Bookmark" items (Ctrl-Shift-0..9). You can navigate to the corresponding positions by using the "Go to Global Bookmark" items. (Ctrl-Alt-0..9).

17) Search results. Shows the results of a pattern search or logs the replacements made.


icon_arrow All nodes can be double clicked to go to their corresponding line in the editor.


icon_arrow The nodes under Uses and Requires (that list the modules used) also have a right click menu, so you can open them in the editor or in the Pod extractor.


icon_arrow The search results node also has a right click menu, to clear the search results or repeat the search.


How code explorer searches for modules


The %INC path in Options or Project Options must be correct. For more information see how OptiPerl finds modules.


What variables are listed


All global variables show up in the code explorer, either scalar, hashes or arrays. Note however that private variables in subroutines are not listed. For example:


$a = 1;                <- Listed

my ($b,$c);                <- Listed


sub test {

my $d = 4;                <- Not Listed

$e = 5;                <- Listed




Results of a pattern search


If had previously done a Pattern Search, then the results of the search will be shown in code explorer, under the node "/pattern/", where pattern is what you had searched for.


Setting the position


This window can be docked to the main editor window by dragging it. If you want to place it over the main editor without it being docked, hold down the ctrl key while dragging it. Undock it by dragging its title bar. Right click on the title bar when undocked for more options.


Renaming variables


You can rename variables using code explorer. Left click on a variable and pause until you can edit it. This is like doing a search and replace in your script.


Exporing the Code Explorer


Select the option Search / Export code explorer. This will output a tab delimited file that can be imported from a database.


When code explorer gets updated


Anytime you edit a script, after a small delay, code explorer will parse your script. This however happens in an idle thread, meaning that the processing power needed will not make editing slower, since updating will pause while typing, using the menus etc. Depending on your processor and the size of the script, the updates might take place instantly while you type. On slower computers and / or larger >200kb scripts you might see it actually disable itself for a few milliseconds to update its tree structure.


Top  Previous  Next