diff options
author | Father Chrysostomos <sprout@cpan.org> | 2011-02-11 14:01:55 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2011-02-11 14:07:24 -0800 |
commit | aa80e1dcb371c94af142cbd5b35b014104f03584 (patch) | |
tree | 263911de5734a2ca65b3049711fdf5e6d262628d /pod/perldata.pod | |
parent | b208c909347c1ee277714eaa1bda5a4e0d85a64e (diff) | |
download | perl-aa80e1dcb371c94af142cbd5b35b014104f03584.tar.gz |
perldata: remove duplicate text from adjacent sections
Diffstat (limited to 'pod/perldata.pod')
-rw-r--r-- | pod/perldata.pod | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/pod/perldata.pod b/pod/perldata.pod index a79ca65cc2..03191b54e1 100644 --- a/pod/perldata.pod +++ b/pod/perldata.pod @@ -668,7 +668,8 @@ of how to arrange for an output ordering. =head2 Subscripts -An array is subscripted by specifying a dollar sign (C<$>), then the +An array can be accessed one scalar at a +time by specifying a dollar sign (C<$>), then the name of the array (without the leading C<@>), then the subscript inside square brackets. For example: @@ -692,15 +693,12 @@ are used. For example: print "Darwin's First Name is ", $scientists{"Darwin"}, "\n"; -=head2 Slices -X<slice> X<array, slice> X<hash, slice> +You can also subscript a list to get a single element from it: -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. + $dir = (getpwnam("daemon"))[7]; - $whoami = $ENV{"USER"}; # one element from the hash - $parent = $ISA[0]; # one element from the array - $dir = (getpwnam("daemon"))[7]; # likewise, but with list +=head2 Slices +X<slice> X<array, slice> X<hash, slice> A slice accesses several elements of a list, an array, or a hash simultaneously using a list of subscripts. It's more convenient |