ЭЛЕКТРОННАЯ БИБЛИОТЕКА КОАПП |
Сборники Художественной, Технической, Справочной, Английской, Нормативной, Исторической, и др. литературы. |
structstruct (
Creates a class, with object methods for each element of the class. The parameter list paramlist can take one of three forms: The array-based element lists are faster and smaller, but the hash-based list is more flexible. The class that is created can be a subclass of the UNIVERSAL class, but not of any other class.struct( CLASS_NAME => [ ELEMENT_LIST ]); # object is array-based struct( CLASS_NAME => { ELEMENT_LIST }); # object is hash-based struct( ELEMENT_LIST ); # class name is current package name # and object is array-based Element listThe items in the ELEMENT_LIST are of the form: where eachNAME => TYPE, ... NAME=>TYPE pair declares one element of the struct . Each element
name is defined as an accessor method, unless a method
is explicitly defined with that name. (In that case, a warning is issued if the
-w flag is set.)Element types and accessor methodsThere are four possible element types, each represented by a string.
Each string may start with an asterisk ( |