Create and initialize a RIV::App object
This section of the SNMP GET access example Perl script
creates and initializes a new RIV::App object. Use
this part of the example script as a guide to creating and initializing
new RIV::App objects in client/server Perl scripts
that retrieve SNMP information.
The SNMP GET access example Perl script creates and
initializes a new RIV::App object as follows:
my $app = new RIV::App($param, "ncp_test:snmp") or 1
die "Can't create RIV application session" unless (defined $app); 2
The following list explains specific numbered items in the previously listed section of the SNMP GET access Perl script example:
- Creates and initializes a new
RIV::Appobject by calling theRIV::Appconstructor. This call to theRIV::Appconstructor takes the following parameters:-
RIV::Param— Specifies a reference to aRIV::Paramobject. In this example, the newly createdRIV::Paramobject is returned to themy $paramvariable in a previous call to theRIV::Paramconstructor. -
$progname— Specifies a string that uniquely identifies an application. In this example, the application name is identified by the stringncp_test:snmp.
-
- If the constructor fails to create and initialize the new
RIV::Appobject, consider this a fatal error and call thediefunction. Thediefunction prints out an appropriate message (in this case, that theRIV::Appconstructor failed) to the standard error stream.