Using Perl 

Syntax

perl <perl_script_file> [<arguments> ...]

perl <perl_script_file> <userid> <password> <data_path>

Prerequisites

Perl is installed on the host.

The following files are shipped with the Replication Manager program for processing Perl scripts:

Open the instperl.pl file. When you do this, the files are copied to the relevant directories.

The Replication Manager supports Perl integration from Perl Version 5.005_02 onwards.

Template for Batch Files

The following section contains examples of batch files in Perl. Their equivalents in the Python script language are also provided for comparison.

Example no. 1
Build a Perl module with reference to the SAP DB Perl Libraries,
parse the call arguments


Perl


Python

Example. 2
Set up a user session with the REPM Server,
Log onto the database instance,
Log off



Perl



Python

Example no. 3
Start a user session,
Log onto the database instance,
Query error code to determine whether table exists
Create a table without querying the error code
Log off



Perl



Python

Example no. 4
Start a user session
Log onto the database instance
Create a table and query the error code
Load data to the table using REPM Server command(s) and query the error code
Log off




Perl




Python

Example no. 5
Start a user session
Log onto the database instance
Load data to the table using REPM Server command(s) and intercept exceptions
Log off



Perl



Python

Perl Classes