|
|||
1. Resource Management in the Solaris Operating System 3. Using the C Interface to Extended Accounting 4. Using the Perl Interface to Extended Accounting 7. Design Considerations for Resource Management Applications in Solaris Zones |
Perl Interface to libexacctObject ModelThe Sun::Solaris::Exacct module is the parent of all the classes provided by libexacct(3LIB) library. libexacct(3LIB) provides operations on types of entities: exacct format files, catalog tags and exacct objects. exacct objects are subdivided into two types.
Benefits of Using the Perl Interface to libexacctThe Perl extensions to extended accounting provide a Perl interface to the underlying libexacct(3LIB) API and offer the following enhancements.
Perl Double-Typed ScalarsThe modules described in this document make extensive use of the Perl double-typed scalar facility. The double-typed scalar facility allows a scalar value to behave either as an integer or as a string, depending upon the context. This behavior is the same as exhibited by the $! Perl variable (errno). The double-typed scalar facility avoids the need to map from an integer value into the corresponding string in order to display a value. The following example illustrates the use of double-typed scalars. # Assume $obj is a Sun::Solaris::Item my $type = $obj->type(); # prints out "2 EO_ITEM" printf("%d %s\n", $type, $type); # Behaves as an integer, $i == 2 my $i = 0 + $type; # Behaves as a string, $s = "abc EO_ITEM xyx" my $s = "abc $type xyz"; |
||
|