summaryrefslogtreecommitdiff
path: root/pod
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-01-19 04:40:04 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-01-19 04:40:04 +0000
commit165f6120bc62123046b2281a8f26dd679e405685 (patch)
treee667ab058f991655451405d895a2f080aeb25fc2 /pod
parent189b2af51bf236b53a02db0b105a3de423d3fff4 (diff)
parent982fa0b99bd3e50eaadd172e08c0a8e5cc2bdfc6 (diff)
downloadperl-165f6120bc62123046b2281a8f26dd679e405685.tar.gz
[win32] integrate changes in winansi
p4raw-id: //depot/win32/perl@431
Diffstat (limited to 'pod')
-rw-r--r--pod/perlfunc.pod1
-rw-r--r--pod/perltie.pod23
2 files changed, 17 insertions, 7 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod
index a89ee99e06..a1184c8a08 100644
--- a/pod/perlfunc.pod
+++ b/pod/perlfunc.pod
@@ -1580,6 +1580,7 @@ elements. That is, modifying an element of a list returned by grep
actually modifies the element in the original list.
See also L</map> for an array composed of the results of the BLOCK or EXPR.
+
=item hex EXPR
=item hex
diff --git a/pod/perltie.pod b/pod/perltie.pod
index c6eb7156ce..79a749e68a 100644
--- a/pod/perltie.pod
+++ b/pod/perltie.pod
@@ -180,17 +180,26 @@ TIESCALAR classes are certainly possible.
=head2 Tying Arrays
A class implementing a tied ordinary array should define the following
-methods: TIEARRAY, FETCH, STORE, and perhaps DESTROY.
+methods: TIEARRAY, FETCH, STORE, FETCHSIZE, STORESIZE and perhaps DESTROY.
-B<WARNING>: Tied arrays are I<incomplete>. They are also distinctly lacking
-something for the C<$#ARRAY> access (which is hard, as it's an lvalue), as
-well as the other obvious array functions, like push(), pop(), shift(),
-unshift(), and splice().
+FETCHSIZE and STORESIZE are used to provide C<$#array> and
+equivalent C<scalar(@array)> access.
+
+The methods POP, PUSH, SHIFT, UNSHIFT, SPLICE are required if the perl
+operator with the corresponding (but lowercase) name is to operate on the
+tied array. The B<Tie::Array> class can be used as a base class to implement
+these in terms of the basic five methods above.
+
+In addition EXTEND will be called when perl would have pre-extended
+allocation in a real array.
+
+This means that tied arrays are now I<complete>. The example below needs
+upgrading to illustrate this. (The documentation in B<Tie::Array> is more
+complete.)
For this discussion, we'll implement an array whose indices are fixed at
its creation. If you try to access anything beyond those bounds, you'll
-take an exception. (Well, if you access an individual element; an
-aggregate assignment would be missed.) For example:
+take an exception. For example:
require Bounded_Array;
tie @ary, 'Bounded_Array', 2;