Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Import Perl Modules and Declare Constants in NETCONF Perl Client Applications

When creating a NETCONF Perl client application, include the following statement at the start of the application. This statement imports the functions provided by the Net::Netconf::Manager object, which the application uses to connect to the NETCONF server on a device.

Include statements to import other Perl modules as appropriate for your application. For example, several of the sample scripts included in the NETCONF Perl distribution import the following standard Perl modules, which include functions that handle input from the command line:

  • Carp—Includes functions for user error warnings.

  • Getopt::Std—Includes functions for reading in keyed options from the command line.

  • Term::ReadKey—Includes functions for controlling terminal modes, for example suppressing onscreen echo of a typed string such as a password.

If the application uses constants, declare their values at this point. For example, the sample script diagnose_bgp.pl includes the following statement to declare a constant for the access method:

The edit_configuration.pl sample script includes the following statements to declare constants for reporting return codes and the status of the configuration database: