$session->put( $object, $property, $value );
It is not recommended that the put() method be used extensively. Instead, use the features of InCharge::object.
This method changes the value of an object property. This version differs from the put_P() primitive in that the latter requires the value type to be specified explicitly, whereas this version determines and caches the type. The following calls are, therefore, equivalent, although the first is preferred.
$obj = $session->object( "Router::gw1" ); $session->{Vendor} = "Cadbury"; $obj->put( "Vendor", "Cadbury" ); $obj->put( Vendor => "Cadbury" ); $session->put( "Router::gw1", "Vendor", "Cadbury" ); $session->object( "Router::gw1" )->{Vendor} = "Cadbury"; $session->callPrimitive( "put_P", "Router", "gw1", "Vendor",[ "STRING", "Cadbury" ] );
When giving a value to an array property, such as the ComposedOf relationship, pass an array reference as shown in the following example:
$obj->{ComposedOf} = [ "Interface::IF-if1", "Interface::IF-if2" ];
Also, you can set more than one property in a single call. This can reduce complexity in the script layout but has minimal performance advantage.
$obj->put( Vendor => "CISCO", Model => "2500", Location => "Behind the coffee machine" );