The get_t() method is like the get() method, except that it returns the type of return value as well as the value itself. The data types are encoded as integer numbers. If the return is an array, then $value will receive a reference to the array. If the return is a scalar, then $value will hold it. The $session->TYPE() method can be used to convert the $type integer value to a mnemonic string.
($type, $value) = $obj->get_t( $property_name );
There is a second syntax that gets the types and values for multiple properties. Each type/value pair is held in a two-element subarray within the returned data.
@types_and_values = $obj->get_t( $prop1 [, $prop2 [, prop3 .. ] ] )
There is also a third syntax gets the types and values for all the properties and relations of the object and stores them in a hash, indexed by the property names.
%all_property_types_and_values = $obj->get_t( );
Example:
$obj = $session->object( "Router::gw1" ); ( $type, $value ) = $obj->get_t( "Vendor" ); print "Vendor value ='$value', \ type = ".$session>TYPE($type)."\n”;
This example will print:
Vendor value='CISCO', type = STRING