X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlmod.pod;h=6da31dee3c9678e9f1f1b723ebe2fffec0e9f1f2;hb=9949743fb3b989b8694b2a5e666ad6a181918a59;hp=2a0f6fecb6207b2691107161c3c649bee095a03d;hpb=5a964f204835a8014f4ba86fc91884cff958ac67;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlmod.pod b/pod/perlmod.pod index 2a0f6fe..6da31de 100644 --- a/pod/perlmod.pod +++ b/pod/perlmod.pod @@ -26,10 +26,16 @@ packages by prefixing the identifier with the package name and a double colon: C<$Package::Variable>. If the package name is null, the C
package is assumed. That is, C<$::sail> is equivalent to C<$main::sail>. -(The old package delimiter was a single quote, but double colon -is now the preferred delimiter, in part because it's more readable -to humans, and in part because it's more readable to B macros. -It also makes C++ programmers feel like they know what's going on.) +The old package delimiter was a single quote, but double colon is now the +preferred delimiter, in part because it's more readable to humans, and +in part because it's more readable to B macros. It also makes C++ +programmers feel like they know what's going on--as opposed to using the +single quote as separator, which was there to make Ada programmers feel +like they knew what's going on. Because the old-fashioned syntax is still +supported for backwards compatibility, if you try to use a string like +C<"This is $owner's house">, you'll be accessing C<$owner::s>; that is, +the $s variable in package C, which is probably not what you meant. +Use braces to disambiguate, as in C<"This is ${owner}'s house">. Packages may be nested inside other packages: C<$OUTER::INNER::var>. This implies nothing about the order of name lookups, however. All symbols