+=head2 Subscripts
+
+An array is subscripted by specifying a dollar sign (C<$>), then the
+name of the array (without the leading C<@>), then the subscript inside
+square brackets. For example:
+
+ @myarray = (5, 50, 500, 5000);
+ print "Element Number 2 is", $myarray[2], "\n";
+
+The array indices start with 0. A negative subscript retrieves its
+value from the end. In our example, C<$myarray[-1]> would have been
+5000, and C<$myarray[-2]> would have been 500.
+
+Hash subscripts are similar, only instead of square brackets curly brackets
+are used. For example:
+
+ %scientists =
+ (
+ "Newton" => "Isaac",
+ "Einstein" => "Albert",
+ "Darwin" => "Charles",
+ "Feynman" => "Richard",
+ );
+
+ print "Darwin's First Name is ", $scientists{"Darwin"}, "\n";
+
+=head2 Slices
+X<slice> X<array, slice> X<hash, slice>
+
+A common way to access an array or a hash is one scalar element at a
+time. You can also subscript a list to get a single element from it.
+
+ $whoami = $ENV{"USER"}; # one element from the hash
+ $parent = $ISA[0]; # one element from the array
+ $dir = (getpwnam("daemon"))[7]; # likewise, but with list
+
+A slice accesses several elements of a list, an array, or a hash
+simultaneously using a list of subscripts. It's more convenient
+than writing out the individual elements as a list of separate
+scalar values.
+
+ ($him, $her) = @folks[0,-1]; # array slice
+ @them = @folks[0 .. 3]; # array slice
+ ($who, $home) = @ENV{"USER", "HOME"}; # hash slice
+ ($uid, $dir) = (getpwnam("daemon"))[2,7]; # list slice
+
+Since you can assign to a list of variables, you can also assign to
+an array or hash slice.
+
+ @days[3..5] = qw/Wed Thu Fri/;
+ @colors{'red','blue','green'}
+ = (0xff0000, 0x0000ff, 0x00ff00);
+ @folks[0, -1] = @folks[-1, 0];
+
+The previous assignments are exactly equivalent to
+
+ ($days[3], $days[4], $days[5]) = qw/Wed Thu Fri/;
+ ($colors{'red'}, $colors{'blue'}, $colors{'green'})
+ = (0xff0000, 0x0000ff, 0x00ff00);
+ ($folks[0], $folks[-1]) = ($folks[-1], $folks[0]);
+
+Since changing a slice changes the original array or hash that it's
+slicing, a C<foreach> construct will alter some--or even all--of the
+values of the array or hash.
+
+ foreach (@array[ 4 .. 10 ]) { s/peter/paul/ }
+
+ foreach (@hash{qw[key1 key2]}) {
+ s/^\s+//; # trim leading whitespace
+ s/\s+$//; # trim trailing whitespace
+ s/(\w+)/\u\L$1/g; # "titlecase" words
+ }
+
+A slice of an empty list is still an empty list. Thus:
+
+ @a = ()[1,0]; # @a has no elements
+ @b = (@a)[0,1]; # @b has no elements
+ @c = (0,1)[2,3]; # @c has no elements
+
+But:
+
+ @a = (1)[1,0]; # @a has two elements
+ @b = (1,undef)[1,0,2]; # @b has three elements
+
+This makes it easy to write loops that terminate when a null list
+is returned:
+
+ while ( ($home, $user) = (getpwent)[7,0]) {
+ printf "%-8s %s\n", $user, $home;
+ }
+
+As noted earlier in this document, the scalar sense of list assignment
+is the number of elements on the right-hand side of the assignment.
+The null list contains no elements, so when the password file is
+exhausted, the result is 0, not 2.
+
+If you're confused about why you use an '@' there on a hash slice
+instead of a '%', think of it like this. The type of bracket (square
+or curly) governs whether it's an array or a hash being looked at.
+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).
+