From 14bbe6f4330f87e98504b75113f2067759f94ecd Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Wed, 7 Aug 2024 11:19:53 +1000 Subject: [PATCH] remove ' as a package separator: update perlmod --- pod/perlmod.pod | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/pod/perlmod.pod b/pod/perlmod.pod index c5fce752c4087..89fe31a56f613 100644 --- a/pod/perlmod.pod +++ b/pod/perlmod.pod @@ -69,21 +69,6 @@ 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--as opposed to using the -single quote as separator, which was there to make Ada programmers feel -like they knew what was 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">. -X<::> X<'> - -Using C<'> as a package separator is deprecated and will be removed in -Perl 5.40. - Packages may themselves contain package separators, as in C<$OUTER::INNER::var>. This implies nothing about the order of name lookups, however. There are no relative packages: all symbols @@ -94,6 +79,9 @@ C<$OUTER::INNER::var>. C refers to a totally separate global package. The custom of treating package names as a hierarchy is very strong, but the language in no way enforces it. +Previously you could use C<'> as a package separator, this was removed +in Perl 5.42. + Only identifiers starting with letters (or underscore) are stored in a package's symbol table. All other symbols are kept in package C
, including all punctuation variables, like $_. In addition,