This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl_hv_placeholders_get() actually takes a const HV *hv.
[perl5.git] / lib / Tie / Array.pm
index f4c6193..af8f51e 100644 (file)
@@ -1,9 +1,9 @@
 package Tie::Array;
 
-use 5.005_64;
+use 5.006_001;
 use strict;
 use Carp;
-our $VERSION = '1.01';
+our $VERSION = '1.03';
 
 # Pod documentation after __END__ below.
 
@@ -11,7 +11,6 @@ sub DESTROY { }
 sub EXTEND  { }
 sub UNSHIFT { scalar shift->SPLICE(0,0,@_) }
 sub SHIFT { shift->SPLICE(0,1) }
-#sub SHIFT   { (shift->SPLICE(0,1))[0] }
 sub CLEAR   { shift->STORESIZE(0) }
 
 sub PUSH
@@ -70,17 +69,17 @@ sub SPLICE {
     for (my $i=0; $i < @_; $i++) {
         $obj->STORE($off+$i,$_[$i]);
     }
-    return @result;
+    return wantarray ? @result : pop @result;
 }
 
 sub EXISTS {
     my $pkg = ref $_[0];
-    croak "$pkg dosn't define an EXISTS method";
+    croak "$pkg doesn't define an EXISTS method";
 }
 
 sub DELETE {
     my $pkg = ref $_[0];
-    croak "$pkg dosn't define a DELETE method";
+    croak "$pkg doesn't define a DELETE method";
 }
 
 package Tie::StdArray;
@@ -120,7 +119,7 @@ Tie::Array - base class for tied arrays
 
 =head1 SYNOPSIS
 
-    package NewArray;
+    package Tie::NewArray;
     use Tie::Array;
     @ISA = ('Tie::Array');
 
@@ -144,7 +143,7 @@ Tie::Array - base class for tied arrays
     sub EXTEND { ... }
     sub DESTROY { ... }
 
-    package NewStdArray;
+    package Tie::NewStdArray;
     use Tie::Array;
 
     @ISA = ('Tie::StdArray');
@@ -179,7 +178,7 @@ For developers wishing to write their own tied arrays, the required methods
 are briefly defined below. See the L<perltie> section for more detailed
 descriptive, as well as example code:
 
-=over
+=over 4
 
 =item TIEARRAY classname, LIST