From 6356c3f1ba85630f8ccec740c2b7a62860630fa9 Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Wed, 7 Aug 2024 11:16:30 +1000 Subject: [PATCH] remove ' as a package separator: update perldata --- pod/perldata.pod | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/pod/perldata.pod b/pod/perldata.pod index 80179f78dc844..da52274876d12 100644 --- a/pod/perldata.pod +++ b/pod/perldata.pod @@ -136,22 +136,17 @@ generic characters, and identifiers should match That is, any word character in the ASCII range, as long as the first character is not a digit. -There are two package separators in Perl: A double colon (C<::>) and a single -quote (C<'>). Use of C<'> as the package separator is deprecated and will be -removed in Perl 5.40. Normal identifiers can start or end with a double -colon, and can contain several parts delimited by double colons. Single -quotes have similar rules, but with the exception that they are not legal at -the end of an identifier: That is, C<$'foo> and C<$foo'bar> are legal, but -C<$foo'bar'> is not. +There is one package separator in Perl: A double colon (C<::>). +Normal identifiers can start or end with a double colon, and can +contain several parts delimited by double colons. + +Previously you could use C<'> as a package separator, this was removed +in Perl 5.42. Additionally, if the identifier is preceded by a sigil -- that is, if the identifier is part of a variable name -- it may optionally be enclosed in braces. -While you can mix double colons with singles quotes, the quotes must come -after the colons: C<$::::'foo> and C<$foo::'bar> are legal, but C<$::'::foo> -and C<$foo'::bar> are not. - Put together, a grammar to match a basic identifier becomes / @@ -164,9 +159,9 @@ Put together, a grammar to match a basic identifier becomes ) ) (? - (?: :: )* '? + (?: :: )* (?&basic_identifier) - (?: (?= (?: :: )+ '? | (?: :: )* ' ) (?&normal_identifier) )? + (?: (?= :: ) (?&normal_identifier) )? (?: :: )* ) (?