From d83f38d8facaed626f27ae5d9f0f66709664dc5e Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Wed, 4 Nov 2009 11:33:12 +0000 Subject: Deprecate use of := to mean an empty attribute list in my $pi := 4; An accident of Perl's parser meant that my $pi := 4; was parsed as an empty attribute list. Empty attribute lists are ignored, hence the above is equivalent to my $pi = 4; However, the fact that it is currently valid syntax means that := cannot be used as new token, without silently changing the meaning of existing code. Hence it is now deprecated, so that it can subsequently be removed, allowing the possibility of := to be used as a new token with new semantics. --- dist/B-Deparse/t/deparse.t | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'dist/B-Deparse') diff --git a/dist/B-Deparse/t/deparse.t b/dist/B-Deparse/t/deparse.t index c9c92f9ca8..12879fc5cb 100644 --- a/dist/B-Deparse/t/deparse.t +++ b/dist/B-Deparse/t/deparse.t @@ -17,7 +17,7 @@ BEGIN { require feature; feature->import(':5.10'); } -use Test::More tests => 78; +use Test::More tests => 81; use Config (); use B::Deparse; @@ -591,3 +591,15 @@ foreach (0..3) { print ++$x, "\n"; } } +#### +my $pi = 4; +#### +no warnings; +my $pi := 4; +>>>> +no warnings; +my $pi = 4; +#### +my $pi : = 4; +>>>> +my $pi = 4; -- cgit v1.2.1