Designing and Managing Behavior Models
-
Alarm Actions - Perl Subroutine - Defining a Perl Subroutine -
Before you can add a Perl subroutine to a transition, you must write it (obviously) and store a compiled version of it in the NerveCenter database.
To define a Perl subroutine within NerveCenter:
From the
Admin
menu in the main client window, choose Perl Subroutine List
.
The Perl Subroutine List window appears.
This window contains a list with an entry for each Perl subroutine defined in your NerveCenter database. The Compiled Status column indicates whether the subroutine has been successfully compiled. From this window, you can add a new subroutine, modify an existing subroutine, or view the notes for a subroutine.
New
button.The Perl Subroutine Definition window appears.
Perl Subroutine Definition Window
This window enables you to name and define a new Perl subroutine.
Name
field.
Notes
button, enter a description in the Perl Subroutine Notes window, and select the OK
button in that window.
Subroutine
text entry box.Use Perl version 5 to write your subroutine. You can also make use of the NerveCenter functions and variables discussed in the sections Functions for Use in Perl Subroutines and NerveCenter Variables
If you right-click in the Perl-subroutine editing area, you'll see a pop-up menu that lists all the functions and variables available for writing Perl subroutines. For more information about this pop-up menu, see the section Using the Pop-Up Menu for Perl.
Save
button in the Perl Subroutine Definition window.NerveCenter automatically attempts to compile the subroutine. If your Perl subroutine does not compile correctly, NerveCenter displays an error message from the Perl compiler. It also saves the subroutine and places it in the Perl Subroutine List, with the Compiled Status listed as Not Compiled.
If your Perl subroutine compiles successfully, the saved subroutine is available for use in a Perl Subroutine alarm action. It won't be executed unless it's made the object of a Perl Subroutine action and the associated alarm transition occurs.
Previous: Perl Subroutine | Next: Functions for Use in Perl Subroutines |
Please send comments or corrections to Information Development | This file was last updated on 10 October © 2002 |