Preparing to Use an AccuRev-Provided Trigger Script

Sample trigger scripts are installed with AccuRev, in the examples subdirectory. These sample scripts are implemented in the platform-neutral Perl scripting language. Use the following procedure to install and use one of these scripts:

  1. Install Perl. There are many sources on the Web for Perl. We recommend the ActivePerl distribution from http://www.activestate.com. This distribution includes a conversion utility, pl2bat, which makes a Perl script executable under Windows, by embedding the Perl code in a Windows batch file (.bat).

  2. Be sure to install Perl on all appropriate machines. Note that some pre-operation triggers run on the client machine, while others run on the server machine. All post-operation triggers run on the AccuRev server machine.

    For faster processing on large XML files, try installing the XML::SAX::ExpatXS Perl module and using that module in your Perl scripts.

  3. Get a copy of the sample script. Copy the sample script from the examples subdirectory of the AccuRev installation directory to an AccuRev workspace. Then use the add command to place the script under version control.

  4. Prepare the script. Open the script in a text editor, and customize the script according to the instructions included as comment lines. Before embarking on complex script customization, be sure to read The Trigger Parameters File.

    Note: The path to the AccuRev executable in the script must not contain unquoted spaces. Either properly quote the spaces for Perl, or use short filenames on Windows platforms (for example, progra~1 if accurev.exe is located in the Program Files directory).

  5. Enable the trigger. Enable the trigger, either with the mktrig command or by placing the script in the proper location. See Enabling a Trigger for details.