X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlref.pod;h=a62276b7825712db6c6ecf5cfd45e4375e5e3b92;hb=e5dd39fcc65538f6d292cb5228105f85fe9eff3e;hp=1d47f376064ccc6598060f52a9798bd1f73a0e63;hpb=479ba38336aaacaf3a7e00a4662d83e2dc833197;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlref.pod b/pod/perlref.pod index 1d47f37..a62276b 100644 --- a/pod/perlref.pod +++ b/pod/perlref.pod @@ -84,7 +84,7 @@ brackets: Here we've created a reference to an anonymous array of three elements whose final element is itself a reference to another anonymous array of three elements. (The multidimensional syntax described later can be used to -access this. For example, after the above, C<$arrayref-E[2][1]> would have +access this. For example, after the above, C<< $arrayref->[2][1] >> would have the value "b".) Taking a reference to an enumerated list is not the same @@ -357,7 +357,7 @@ syntactic sugar, the examples for method 2 may be written: The left side of the arrow can be any expression returning a reference, including a previous dereference. Note that C<$array[$x]> is I the -same thing as C<$array-E[$x]> here: +same thing as C<< $array->[$x] >> here: $array[$x]->{"foo"}->[0] = "January"; @@ -365,7 +365,7 @@ This is one of the cases we mentioned earlier in which references could spring into existence when in an lvalue context. Before this statement, C<$array[$x]> may have been undefined. If so, it's automatically defined with a hash reference so that we can look up -C<{"foo"}> in it. Likewise C<$array[$x]-E{"foo"}> will automatically get +C<{"foo"}> in it. Likewise C<< $array[$x]->{"foo"} >> will automatically get defined with an array reference so that we can look up C<[0]> in it. This process is called I. @@ -528,7 +528,8 @@ makes it more than a bareword: $array{ +shift } $array{ shift @_ } -The B<-w> switch will warn you if it interprets a reserved word as a string. +The C pragma or the B<-w> switch will warn you if it +interprets a reserved word as a string. But it will no longer warn you about using lowercase words, because the string is effectively quoted. @@ -537,6 +538,13 @@ string is effectively quoted. B: This section describes an experimental feature. Details may change without notice in future versions. +B: The current user-visible implementation of pseudo-hashes +(the weird use of the first array element) is deprecated starting from +Perl 5.8.0 and will be removed in Perl 5.10.0, and the feature will be +implemented differently. Not only is the current interface rather ugly, +but the current implementation slows down normal array and hash use quite +noticeably. The 'fields' pragma interface will remain available. + Beginning with release 5.005 of Perl, you may use an array reference in some contexts that would normally require a hash reference. This allows you to access array elements using symbolic names, as if they