short documentation for key/value hash/array slices
authorRuslan Zakirov <ruz@bestpractical.com>
Sun, 8 Sep 2013 15:40:34 +0000 (19:40 +0400)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 13 Sep 2013 08:25:35 +0000 (01:25 -0700)
pod/perldata.pod

index 8f05430..2b7a306 100644 (file)
@@ -917,6 +917,23 @@ On the other hand, the leading symbol ('$' or '@') on the array or
 hash indicates whether you are getting back a singular value (a
 scalar) or a plural one (a list).
 
+=head3 Key/value hash slices
+
+A key/value hash slice operation is variant of slice operation that
+return list of key/value pairs rather than just values:
+
+    %sub = %h{'foo', 'bar'}; # key/value hash slice
+
+However, result of such slice can not be localized, deleted or used
+in assignment. Otherwise very much consistent with hash slices.
+
+=head3 Index/value array slices
+
+Like for hash the following returns list of pairs, but with
+index/value pairs:
+
+    @list = %a[3,4,5];
+
 =head2 Typeglobs and Filehandles
 X<typeglob> X<filehandle> X<*>