Tie::OffsetArray - Tie one array to another, with index offset
use Tie::OffsetArray; tie @a, 'Tie::OffsetArray', 1, \@b; # offset=1; use given array. tie @c, 'Tie::OffsetArray', 2; # use anonymous array. $a = 'x'; # assign to $b; tied(@a)->array-> = 'y'; # assign to $b.
When tied to this class, an array's behavior is completely normal. For its internal storage, it uses another array, either one supplied by the caller, or a new anonymous one. Accesses to the tied array are mapped down to the storage array by offsetting the index by some constant amount.
A special method on the tied object returns a reference to the storage array, so that the elements below the offset can be accessed. This is particularly useful if the storage array was not supplied by the caller.
email@example.com (John Porter)
This is free software. This software may be modified and distributed under the same terms as Perl itself.