Revert the -f ambiguousity patch, seems to cause
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 11 Dec 2000 22:32:06 +0000 (22:32 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 11 Dec 2000 22:32:06 +0000 (22:32 +0000)
too much hassle (the interpret -Q as a function
where Q is not a known filetest part is left in).

p4raw-id: //depot/perl@8084

lib/ExtUtils/Liblist.pm
pod/perldiag.pod
t/pragma/warn/toke
toke.c

index 48c0ad5..5e2f91d 100644 (file)
@@ -1,7 +1,5 @@
 package ExtUtils::Liblist;
 
-no warnings 'ambiguous'; # silence the -f() file tests.
-
 @ISA = qw(ExtUtils::Liblist::Kid File::Spec);
 
 sub lsdir {
index 830faab..9baf175 100644 (file)
@@ -59,17 +59,6 @@ L<perlfunc/accept>.
 (F) The '!' is allowed in pack() and unpack() only after certain types.
 See L<perlfunc/pack>.
 
-=item Ambiguous -%c() resolved as a file test
-
-(W ambiguous) You used a "-" right in front a call to a subroutine
-that has the same name as a Perl file test (C<r w x o R W X O e z s
-f d l p S u g k b c t T B M A C>).
-
-To disambiguate it as a subroutine call, use either an extra space after
-the "-", C<- f(...)>, or an extra set of parentheses, C<-(f(...))>.
-To disambiguate it as a file test, use an extra space after the operator
-name C<-f (...)>, or add the space and remove the parentheses, C<-f ...>.
-
 =item Ambiguous call resolved as CORE::%s(), qualify as such or use &
 
 (W ambiguous) A subroutine you have declared has the same name as a Perl
index 1f8b142..2c9433b 100644 (file)
@@ -123,9 +123,6 @@ toke.c      AOK
     Ambiguous use of %c resolved as operator %c
         *foo *foo
 
-    Ambiguous -f%c call resolved as a file test                [yylex]
-       sub f { }; -f(0)
-
 __END__
 # toke.c 
 use warnings 'deprecated' ;
@@ -567,19 +564,3 @@ no warnings 'ambiguous';
 "@mjd_previously_unused_array";        
 EXPECT
 Possible unintended interpolation of @mjd_previously_unused_array in string at - line 3.
-########
-# toke.c
-use warnings 'ambiguous';
-sub f { 24 }
--f("TEST");
-print - f("TEST");
-print -(f("TEST"));
-print -f ("TEST");
-print -f "TEST";
-sub Q { 42 };
-print -Q();
-EXPECT
-Ambiguous -f() resolved as a file test at - line 4.
-Ambiguous -f() resolved as a file test at - line 7.
--24-2411-42
-
diff --git a/toke.c b/toke.c
index d8ffc1e..cd6ed1d 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -2850,15 +2850,14 @@ Perl_yylex(pTHX)
                DEBUG_T( { PerlIO_printf(Perl_debug_log,
                         "### Saw file test %c\n", ftst);
                } )
-               if (*s == '(' && ckWARN(WARN_AMBIGUOUS))
-                   Perl_warner(aTHX_ WARN_AMBIGUOUS,
-                               "Ambiguous -%c() resolved as a file test",
-                               tmp);
                FTST(ftst);
            }
            else {
                /* Assume it was a minus followed by a one-letter named
                 * subroutine call (or a -bareword), then. */
+               DEBUG_T( { PerlIO_printf(Perl_debug_log,
+                        "### %c looked like a file test but was not\n", ftst);
+               } )
                s -= 2;
            }
        }