Tie::StdArray inherits from Tie::Array and provides the methods
needed for tied arrays implemented as blessed references to an
"inner" Perl array. It causes tied
arrays to behave like standard arrays, allowing for selective method
overloading.
TIEARRAY classname, list
Constructor. This method is invoked by the command
tie @array ,
classname. Associates an array instance
with the specified class. list represents
additional arguments needed to complete the association. Should
return an object of a class that provides the remaining methods.
CLEAR this
Clears all values from the tied array associated with object
this.
DESTROY this
Normal object destructor.
EXTEND this, count
Doesn't need to do anything. Provides information
that the array will likely grow to have
count entries.
FETCH this, index
Retrieves the data item in index for the
tied array associated with object this.
FETCHSIZE this
Returns the number of items in the tied array associated with object
this.
POP this
Removes the last element from the array and returns it.
PUSH this, list
Appends elements of list to the array.
SHIFT this
Removes and returns the first element of the array, shifting the
remaining elements down.
SPLICE this, offset, length, list
Performs the equivalent of a splice on the
array. Returns a list of the original
length elements at the specified offset.
The arguments are:
- offset
-
Optional. Defaults to 0; if negative, counts back
from the end of the array.
- length
-
Optional. Defaults to the rest of the array.
- list
-
May be empty.
STORE this, index, value
Stores value of a data item into index for
the tied array associated with object
this. If the resulting array is larger
than the class's mapping for the array,
undef should be returned for new positions.
STORESIZE this, count
Sets the total number of items in the tied array associated with
object this to
count. If this makes the array larger than
the class's mapping for the array, then
undef should be returned for new positions. If it
makes the array smaller than the mapping, then entries beyond
count should be deleted.
UNSHIFT this, list
Inserts list elements at the beginning of
the array, moving existing elements up to make room.