summaryrefslogtreecommitdiff
path: root/pod/perltie.pod
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-05-28 08:50:32 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-05-28 08:50:32 +0000
commit0b931be4791f7d772317758feb118bd4d693a29e (patch)
tree9476bbc133047acff757c6e744dbbf1986b280ca /pod/perltie.pod
parent5ce0178e8e6a35225316965a9dccd12fa35eb60d (diff)
downloadperl-0b931be4791f7d772317758feb118bd4d693a29e.tar.gz
add note about the handling of negative indices to tied arrays
(from Michael G Schwern <schwern@pobox.com>) p4raw-id: //depot/perl@6138
Diffstat (limited to 'pod/perltie.pod')
-rw-r--r--pod/perltie.pod6
1 files changed, 6 insertions, 0 deletions
diff --git a/pod/perltie.pod b/pod/perltie.pod
index 95de3bb928..49bf98999c 100644
--- a/pod/perltie.pod
+++ b/pod/perltie.pod
@@ -260,6 +260,10 @@ index whose value we're trying to fetch.
return $self->{ARRAY}[$idx];
}
+If a negative array index is used to read from an array, the index
+will be translated to a positive one internally by calling FETCHSIZE
+before being passed to FETCH.
+
As you may have noticed, the name of the FETCH method (et al.) is the same
for all accesses, even though the constructors differ in names (TIESCALAR
vs TIEARRAY). While in theory you could have the same class servicing
@@ -281,6 +285,8 @@ there. For example:
}
return $self->{ARRAY}[$idx] = $value;
}
+
+Negative indexes are treated the same as with FETCH.
=item DESTROY this