-
Notifications
You must be signed in to change notification settings - Fork 581
Unexpected complaint of NE deprecation #2226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
From [email protected]Created by [email protected]Perl unexpectedly complains about the use of NE in a script that resembles #!/usr/bin/perl -w use Data::Dumper; %test = ( print Dumper(\%test); When this script is run or is checked with -c, the following error message Use of NE is deprecated at test.pl line 7. However, the data in the hash are correct. This problem does not occur Perl Info
|
From [Unknown Contact. See original ticket]On Jul 17, Ryan Herbert said:
You'll get the same message for EQ, LE, GE, LT, and GT, which are the $foo NE $bar is "legal" Perl code, except that -w complains that 'NE' is deprecated. You got away with murder because the 'NE' is followed by a =>, which perl -we 'open NE, "foo"' perl -we 'open NE => "foo"' Whatever the issue, Perl allows the two-character string comparison |
From @mjdominus
'NE' is a long-dead synonym for 'ne'. The warning is probably But I think it might be better to just eliminate support for NE |
From [Unknown Contact. See original ticket]2000-07-17-12:59:32 Mark-Jason Dominus:
Looks safe to me; I don't think any current module uses NE in a way find . -type f -printf '%P\n' | \ on my modules-unpacked directory, the generated using the script I Date: Thu, 13 Jul 2000 13:33:53 -0400 -Bennett Apache-iNcom-0.09/lib/HTML/FormValidator.pm:MA MI MN MS MO MT NE NV NH NJ NM NY NC ND OH OK OR PA PR RI |
From @TimToadyMark-Jason Dominus writes: I'd say kill it. Larry |
From [Unknown Contact. See original ticket]Lightning flashed, thunder crashed and Larry Wall <larry@wall.org> whispered: This is the first time in a long time that I've tried to submit a patch. -spp Inline Patchdiff -bBru perl-5.6.0/t/op/do.t perl-5.6.work/t/op/do.t
--- perl-5.6.0/t/op/do.t Wed Mar 8 13:12:52 2000
+++ perl-5.6.work/t/op/do.t Tue Jul 18 14:23:52 2000
@@ -21,18 +21,18 @@
$_[0] = "not ok 1\n";
$result = do foo1("ok 1\n");
print "#2\t:$result: eq :value:\n";
-if ($result EQ 'value') { print "ok 2\n"; } else { print "not ok 2\n"; }
-if ($_[0] EQ "not ok 1\n") { print "ok 3\n"; } else { print "not ok 3\n"; }
+if ($result eq 'value') { print "ok 2\n"; } else { print "not ok 2\n"; }
+if ($_[0] eq "not ok 1\n") { print "ok 3\n"; } else { print "not ok 3\n"; }
$_[0] = "not ok 4\n";
$result = do foo2("not ok 4\n","ok 4\n","not ok 4\n");
print "#5\t:$result: eq :value:\n";
-if ($result EQ 'value') { print "ok 5\n"; } else { print "not ok 5\n"; }
-if ($_[0] EQ "not ok 4\n") { print "ok 6\n"; } else { print "not ok 6\n"; }
+if ($result eq 'value') { print "ok 5\n"; } else { print "not ok 5\n"; }
+if ($_[0] eq "not ok 4\n") { print "ok 6\n"; } else { print "not ok 6\n"; }
$result = do{print "ok 7\n"; 'value';};
print "#8\t:$result: eq :value:\n";
-if ($result EQ 'value') { print "ok 8\n"; } else { print "not ok 8\n"; }
+if ($result eq 'value') { print "ok 8\n"; } else { print "not ok 8\n"; }
sub blather {
print @_;
diff -bBru perl-5.6.0/t/pragma/warn/2use perl-5.6.work/t/pragma/warn/2use
--- perl-5.6.0/t/pragma/warn/2use Mon Mar 13 05:32:18 2000
+++ perl-5.6.work/t/pragma/warn/2use Tue Jul 18 15:11:53 2000
@@ -12,28 +12,6 @@
BEGIN failed--compilation aborted at - line 3.
########
-# Check compile time scope of pragma
-use warnings 'deprecated' ;
-{
- no warnings ;
- 1 if $a EQ $b ;
-}
-1 if $a EQ $b ;
-EXPECT
-Use of EQ is deprecated at - line 8.
-########
-
-# Check compile time scope of pragma
-no warnings;
-{
- use warnings 'deprecated' ;
- 1 if $a EQ $b ;
-}
-1 if $a EQ $b ;
-EXPECT
-Use of EQ is deprecated at - line 6.
-########
-
# Check runtime scope of pragma
use warnings 'uninitialized' ;
{
@@ -67,55 +45,27 @@
Use of uninitialized value in scalar chop at - line 6.
########
-use warnings 'deprecated' ;
-1 if $a EQ $b ;
-EXPECT
-Use of EQ is deprecated at - line 3.
-########
-
--FILE-- abc
-1 if $a EQ $b ;
+1 if $a eq $b ;
1;
--FILE--
-use warnings 'deprecated' ;
require "./abc";
EXPECT
########
--FILE-- abc
-use warnings 'deprecated' ;
1;
--FILE--
require "./abc";
-1 if $a EQ $b ;
+1 if $a eq $b ;
EXPECT
########
---FILE-- abc
-use warnings 'deprecated' ;
-1 if $a EQ $b ;
-1;
---FILE--
-use warnings 'uninitialized' ;
-require "./abc";
-my $a ; chop $a ;
-EXPECT
-Use of EQ is deprecated at ./abc line 2.
-Use of uninitialized value in scalar chop at - line 3.
-########
-
---FILE-- abc.pm
-use warnings 'deprecated' ;
-1 if $a EQ $b ;
-1;
---FILE--
use warnings 'uninitialized' ;
-use abc;
my $a ; chop $a ;
EXPECT
-Use of EQ is deprecated at abc.pm line 2.
Use of uninitialized value in scalar chop at - line 3.
########
@@ -164,49 +114,6 @@
# Check scope of pragma with eval
no warnings ;
-eval {
- 1 if $a EQ $b ;
-}; print STDERR $@ ;
-1 if $a EQ $b ;
-EXPECT
-
-########
-
-# Check scope of pragma with eval
-no warnings ;
-eval {
- use warnings 'deprecated' ;
- 1 if $a EQ $b ;
-}; print STDERR $@ ;
-1 if $a EQ $b ;
-EXPECT
-Use of EQ is deprecated at - line 6.
-########
-
-# Check scope of pragma with eval
-use warnings 'deprecated' ;
-eval {
- 1 if $a EQ $b ;
-}; print STDERR $@ ;
-1 if $a EQ $b ;
-EXPECT
-Use of EQ is deprecated at - line 5.
-Use of EQ is deprecated at - line 7.
-########
-
-# Check scope of pragma with eval
-use warnings 'deprecated' ;
-eval {
- no warnings ;
- 1 if $a EQ $b ;
-}; print STDERR $@ ;
-1 if $a EQ $b ;
-EXPECT
-Use of EQ is deprecated at - line 8.
-########
-
-# Check scope of pragma with eval
-no warnings ;
eval '
my $b ; chop $b ;
'; print STDERR $@ ;
@@ -248,61 +155,10 @@
Use of uninitialized value in scalar chop at - line 8.
########
-# Check scope of pragma with eval
-no warnings ;
-eval '
- 1 if $a EQ $b ;
-'; print STDERR $@ ;
-1 if $a EQ $b ;
-EXPECT
-
-########
-
-# Check scope of pragma with eval
-no warnings ;
-eval q[
- use warnings 'deprecated' ;
- 1 if $a EQ $b ;
-]; print STDERR $@;
-1 if $a EQ $b ;
-EXPECT
-Use of EQ is deprecated at (eval 1) line 3.
-########
-
-# Check scope of pragma with eval
-use warnings 'deprecated' ;
-eval '
- 1 if $a EQ $b ;
-'; print STDERR $@;
-1 if $a EQ $b ;
-EXPECT
-Use of EQ is deprecated at - line 7.
-Use of EQ is deprecated at (eval 1) line 2.
-########
-
-# Check scope of pragma with eval
-use warnings 'deprecated' ;
-eval '
- no warnings ;
- 1 if $a EQ $b ;
-'; print STDERR $@;
-1 if $a EQ $b ;
-EXPECT
-Use of EQ is deprecated at - line 8.
-########
-
# Check the additive nature of the pragma
-1 if $a EQ $b ;
my $a ; chop $a ;
-use warnings 'deprecated' ;
-1 if $a EQ $b ;
-my $b ; chop $b ;
+use warnings 'deprecated';
use warnings 'uninitialized' ;
-my $c ; chop $c ;
-no warnings 'deprecated' ;
-1 if $a EQ $b ;
-EXPECT
-Use of EQ is deprecated at - line 6.
-Use of uninitialized value in scalar chop at - line 9.
-Use of uninitialized value in string eq at - line 11.
-Use of uninitialized value in string eq at - line 11.
+my $b ; chop $b ;
+EXPECT
+Use of uninitialized value in scalar chop at - line 6.
diff -bBru perl-5.6.0/t/pragma/warn/4lint perl-5.6.work/t/pragma/warn/4lint
--- perl-5.6.0/t/pragma/warn/4lint Mon Dec 27 19:00:21 1999
+++ perl-5.6.work/t/pragma/warn/4lint Tue Jul 18 15:18:53 2000
@@ -4,12 +4,9 @@
-W
# lint: check compile time $^W is zapped
BEGIN { $^W = 0 ;}
-$a = $b = 1 ;
-$a = 1 if $a EQ $b ;
close STDIN ; print STDIN "abc" ;
EXPECT
-Use of EQ is deprecated at - line 5.
-print() on closed filehandle main::STDIN at - line 6.
+print() on closed filehandle main::STDIN at - line 4.
########
-W
# lint: check runtime $^W is zapped
@@ -30,12 +27,9 @@
-W
# lint: check "no warnings" is zapped
no warnings ;
-$a = $b = 1 ;
-$a = 1 if $a EQ $b ;
close STDIN ; print STDIN "abc" ;
EXPECT
-Use of EQ is deprecated at - line 5.
-print() on closed filehandle main::STDIN at - line 6.
+print() on closed filehandle main::STDIN at - line 4.
########
-W
# lint: check "no warnings" is zapped
@@ -57,56 +51,40 @@
########
-W
--FILE-- abc.pm
-no warnings 'deprecated' ;
-my ($a, $b) = (0,0);
-1 if $a EQ $b ;
1;
--FILE--
no warnings 'uninitialized' ;
use abc;
my $a ; chop $a ;
EXPECT
-Use of EQ is deprecated at abc.pm line 3.
Use of uninitialized value in scalar chop at - line 3.
########
-W
--FILE-- abc
-no warnings 'deprecated' ;
-my ($a, $b) = (0,0);
-1 if $a EQ $b ;
1;
--FILE--
no warnings 'uninitialized' ;
require "./abc";
my $a ; chop $a ;
EXPECT
-Use of EQ is deprecated at ./abc line 3.
Use of uninitialized value in scalar chop at - line 3.
########
-W
--FILE-- abc.pm
-BEGIN {$^W = 0}
-my ($a, $b) = (0,0);
-1 if $a EQ $b ;
1;
--FILE--
$^W = 0 ;
use abc;
my $a ; chop $a ;
EXPECT
-Use of EQ is deprecated at abc.pm line 3.
Use of uninitialized value in scalar chop at - line 3.
########
-W
--FILE-- abc
-BEGIN {$^W = 0}
-my ($a, $b) = (0,0);
-1 if $a EQ $b ;
1;
--FILE--
$^W = 0 ;
require "./abc";
my $a ; chop $a ;
EXPECT
-Use of EQ is deprecated at ./abc line 3.
Use of uninitialized value in scalar chop at - line 3.
diff -bBru perl-5.6.0/t/pragma/warn/5nolint perl-5.6.work/t/pragma/warn/5nolint
--- perl-5.6.0/t/pragma/warn/5nolint Fri Dec 3 23:22:07 1999
+++ perl-5.6.work/t/pragma/warn/5nolint Tue Jul 18 14:45:21 2000
@@ -4,8 +4,6 @@
-X
# nolint: check compile time $^W is zapped
BEGIN { $^W = 1 ;}
-$a = $b = 1 ;
-$a = 1 if $a EQ $b ;
close STDIN ; print STDIN "abc" ;
EXPECT
########
@@ -26,8 +24,6 @@
-X
# nolint: check "no warnings" is zapped
use warnings ;
-$a = $b = 1 ;
-$a = 1 if $a EQ $b ;
close STDIN ; print STDIN "abc" ;
EXPECT
########
@@ -49,9 +45,6 @@
########
-X
--FILE-- abc.pm
-use warnings 'deprecated' ;
-my ($a, $b) = (0,0);
-1 if $a EQ $b ;
1;
--FILE--
use warnings 'uninitialized' ;
@@ -61,9 +54,6 @@
########
-X
--FILE-- abc
-use warnings 'deprecated' ;
-my ($a, $b) = (0,0);
-1 if $a EQ $b ;
1;
--FILE--
use warnings 'uninitialized' ;
@@ -73,9 +63,6 @@
########
-X
--FILE-- abc.pm
-BEGIN {$^W = 1}
-my ($a, $b) = (0,0);
-1 if $a EQ $b ;
1;
--FILE--
$^W = 1 ;
@@ -85,9 +72,6 @@
########
-X
--FILE-- abc
-BEGIN {$^W = 1}
-my ($a, $b) = (0,0);
-1 if $a EQ $b ;
1;
--FILE--
$^W = 1 ;
diff -bBru perl-5.6.0/t/pragma/warn/7fatal perl-5.6.work/t/pragma/warn/7fatal
--- perl-5.6.0/t/pragma/warn/7fatal Wed Dec 8 01:23:15 1999
+++ perl-5.6.work/t/pragma/warn/7fatal Tue Jul 18 15:17:38 2000
@@ -2,18 +2,6 @@
__END__
-# Check compile time warning
-use warnings FATAL => 'deprecated' ;
-{
- no warnings ;
- 1 if $a EQ $b ;
-}
-1 if $a EQ $b ;
-print STDERR "The End.\n" ;
-EXPECT
-Use of EQ is deprecated at - line 8.
-########
-
# Check runtime scope of pragma
use warnings FATAL => 'uninitialized' ;
{
@@ -38,51 +26,10 @@
Use of uninitialized value in scalar chop at - line 6.
########
---FILE-- abc
-1 if $a EQ $b ;
-1;
---FILE--
-use warnings FATAL => 'deprecated' ;
-require "./abc";
-EXPECT
-
-########
-
---FILE-- abc
-use warnings FATAL => 'deprecated' ;
-1;
---FILE--
-require "./abc";
-1 if $a EQ $b ;
-EXPECT
-
-########
-
---FILE-- abc
-use warnings 'deprecated' ;
-1 if $a EQ $b ;
-1;
---FILE--
use warnings FATAL => 'uninitialized' ;
-require "./abc";
my $a ; chop $a ;
print STDERR "The End.\n" ;
EXPECT
-Use of EQ is deprecated at ./abc line 2.
-Use of uninitialized value in scalar chop at - line 3.
-########
-
---FILE-- abc.pm
-use warnings 'deprecated' ;
-1 if $a EQ $b ;
-1;
---FILE--
-use warnings FATAL => 'uninitialized' ;
-use abc;
-my $a ; chop $a ;
-print STDERR "The End.\n" ;
-EXPECT
-Use of EQ is deprecated at abc.pm line 2.
Use of uninitialized value in scalar chop at - line 3.
########
@@ -125,52 +72,6 @@
# Check scope of pragma with eval
no warnings ;
-eval {
- use warnings FATAL => 'deprecated' ;
- 1 if $a EQ $b ;
-}; print STDERR "-- $@" ;
-1 if $a EQ $b ;
-print STDERR "The End.\n" ;
-EXPECT
-Use of EQ is deprecated at - line 6.
-########
-
-# Check scope of pragma with eval
-use warnings FATAL => 'deprecated' ;
-eval {
- 1 if $a EQ $b ;
-}; print STDERR "-- $@" ;
-1 if $a EQ $b ;
-print STDERR "The End.\n" ;
-EXPECT
-Use of EQ is deprecated at - line 5.
-########
-
-# Check scope of pragma with eval
-use warnings FATAL => 'deprecated' ;
-eval {
- no warnings ;
- 1 if $a EQ $b ;
-}; print STDERR $@ ;
-1 if $a EQ $b ;
-print STDERR "The End.\n" ;
-EXPECT
-Use of EQ is deprecated at - line 8.
-########
-
-# Check scope of pragma with eval
-no warnings ;
-eval {
- use warnings FATAL => 'deprecated' ;
-}; print STDERR $@ ;
-1 if $a EQ $b ;
-print STDERR "The End.\n" ;
-EXPECT
-The End.
-########
-
-# Check scope of pragma with eval
-no warnings ;
eval q[
use warnings FATAL => 'uninitialized' ;
my $b ; chop $b ;
@@ -204,39 +105,3 @@
print STDERR "The End.\n" ;
EXPECT
Use of uninitialized value in scalar chop at - line 8.
-########
-
-# Check scope of pragma with eval
-no warnings ;
-eval q[
- use warnings FATAL => 'deprecated' ;
- 1 if $a EQ $b ;
-]; print STDERR "-- $@";
-1 if $a EQ $b ;
-print STDERR "The End.\n" ;
-EXPECT
--- Use of EQ is deprecated at (eval 1) line 3.
-The End.
-########
-
-# Check scope of pragma with eval
-use warnings FATAL => 'deprecated' ;
-eval '
- 1 if $a EQ $b ;
-'; print STDERR "-- $@";
-print STDERR "The End.\n" ;
-EXPECT
--- Use of EQ is deprecated at (eval 1) line 2.
-The End.
-########
-
-# Check scope of pragma with eval
-use warnings FATAL => 'deprecated' ;
-eval '
- no warnings ;
- 1 if $a EQ $b ;
-'; print STDERR "-- $@";
-1 if $a EQ $b ;
-print STDERR "The End.\n" ;
-EXPECT
-Use of EQ is deprecated at - line 8.
diff -bBru perl-5.6.0/t/pragma/warn/8signal perl-5.6.work/t/pragma/warn/8signal
--- perl-5.6.0/t/pragma/warn/8signal Thu Mar 2 14:24:16 2000
+++ perl-5.6.work/t/pragma/warn/8signal Tue Jul 18 15:20:11 2000
@@ -6,13 +6,13 @@
# 8signal
BEGIN { $| = 1; $SIG{__WARN__} = sub { print "WARN -- @_" } }
BEGIN { $SIG{__DIE__} = sub { print "DIE -- @_" } }
-1 if 1 EQ 2 ;
-use warnings qw(deprecated) ;
-1 if 1 EQ 2 ;
-use warnings FATAL => qw(deprecated) ;
-1 if 1 EQ 2 ;
+1 if chop($a);
+use warnings qw(uninitialized) ;
+1 if chop($a);
+use warnings FATAL => qw(uninitialized) ;
+1 if chop($a);
print "The End.\n" ;
EXPECT
-WARN -- Use of EQ is deprecated at - line 6.
-DIE -- Use of EQ is deprecated at - line 8.
-Use of EQ is deprecated at - line 8.
+WARN -- Use of uninitialized value in scalar chop at - line 6.
+DIE -- Use of uninitialized value in scalar chop at - line 8.
+Use of uninitialized value in scalar chop at - line 8.
diff -bBru perl-5.6.0/t/pragma/warn/toke perl-5.6.work/t/pragma/warn/toke
--- perl-5.6.0/t/pragma/warn/toke Tue Feb 22 03:53:00 2000
+++ perl-5.6.work/t/pragma/warn/toke Tue Jul 18 14:38:48 2000
@@ -3,12 +3,6 @@
we seem to have lost a few ambiguous warnings!!
- 1 if $a EQ $b ;
- 1 if $a NE $b ;
- 1 if $a LT $b ;
- 1 if $a GT $b ;
- 1 if $a GE $b ;
- 1 if $a LE $b ;
$a = <<;
Use of comma-less variable list is deprecated
(called 3 times via depcom)
@@ -131,27 +125,6 @@
__END__
# toke.c
-use warnings 'deprecated' ;
-1 if $a EQ $b ;
-1 if $a NE $b ;
-1 if $a GT $b ;
-1 if $a LT $b ;
-1 if $a GE $b ;
-1 if $a LE $b ;
-no warnings 'deprecated' ;
-1 if $a EQ $b ;
-1 if $a NE $b ;
-1 if $a GT $b ;
-1 if $a LT $b ;
-1 if $a GE $b ;
-1 if $a LE $b ;
-EXPECT
-Use of EQ is deprecated at - line 3.
-Use of NE is deprecated at - line 4.
-Use of GT is deprecated at - line 5.
-Use of LT is deprecated at - line 6.
-Use of GE is deprecated at - line 7.
-Use of LE is deprecated at - line 8.
########
# toke.c
use warnings 'deprecated' ;
diff -bBru perl-5.6.0/toke.c perl-5.6.work/toke.c
--- perl-5.6.0/toke.c Tue Mar 21 00:30:21 2000
+++ perl-5.6.work/toke.c Tue Jul 18 14:20:30 2000
@@ -5076,7 +5076,6 @@
}
break;
case 'E':
- if (strEQ(d,"EQ")) { deprecate(d); return -KEY_eq;}
if (strEQ(d,"END")) return KEY_END;
break;
case 'e':
@@ -5142,12 +5141,6 @@
break;
}
break;
- case 'G':
- if (len == 2) {
- if (strEQ(d,"GT")) { deprecate(d); return -KEY_gt;}
- if (strEQ(d,"GE")) { deprecate(d); return -KEY_ge;}
- }
- break;
case 'g':
if (strnEQ(d,"get",3)) {
d += 3;
@@ -5247,12 +5240,6 @@
if (strEQ(d,"kill")) return -KEY_kill;
}
break;
- case 'L':
- if (len == 2) {
- if (strEQ(d,"LT")) { deprecate(d); return -KEY_lt;}
- if (strEQ(d,"LE")) { deprecate(d); return -KEY_le;}
- }
- break;
case 'l':
switch (len) {
case 2:
@@ -5303,9 +5290,6 @@
if (strEQ(d,"msgsnd")) return -KEY_msgsnd;
break;
}
- break;
- case 'N':
- if (strEQ(d,"NE")) { deprecate(d); return -KEY_ne;}
break;
case 'n':
if (strEQ(d,"next")) return KEY_next; |
From @pmqsFrom: Stephen P. Potter [mailto:spp@ds.net]
Uh oh! The majority of the tests you've removed from the warnings test harness Paul |
From @jhiOn Wed, Jul 19, 2000 at 08:05:49PM +0100, Paul Marquess wrote:
Could you rework the patch? |
From @pmqsFrom: Jarkko Hietaniemi [mailto:jhi@iki.fi]
Sure. Paul |
From @pmqs...
Here you are. Paul begin 666 DEP.UUE |
From @jhiOn Wed, Jul 26, 2000 at 11:40:18PM +0100, Paul Marquess wrote:
And there it is. (double uuencoded patch, eh?) |
From @pmqsFrom: Jarkko Hietaniemi [mailto:jhi@iki.fi]
Belt & Braces. :-) Paul |
Migrated from rt.perl.org#3537 (status was 'resolved')
Searchable as RT3537$
The text was updated successfully, but these errors were encountered: