From: Jarkko Hietaniemi Date: Mon, 11 Dec 2000 22:32:06 +0000 (+0000) Subject: Revert the -f ambiguousity patch, seems to cause X-Git-Tag: accepted/trunk/20130322.191538~33339 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=95c31fe33ee6822711c5d165d868e95b4502fd4b;p=platform%2Fupstream%2Fperl.git Revert the -f ambiguousity patch, seems to cause 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 --- diff --git a/lib/ExtUtils/Liblist.pm b/lib/ExtUtils/Liblist.pm index 48c0ad5..5e2f91d 100644 --- a/lib/ExtUtils/Liblist.pm +++ b/lib/ExtUtils/Liblist.pm @@ -1,7 +1,5 @@ package ExtUtils::Liblist; -no warnings 'ambiguous'; # silence the -f() file tests. - @ISA = qw(ExtUtils::Liblist::Kid File::Spec); sub lsdir { diff --git a/pod/perldiag.pod b/pod/perldiag.pod index 830faab..9baf175 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -59,17 +59,6 @@ L. (F) The '!' is allowed in pack() and unpack() only after certain types. See L. -=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). - -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 diff --git a/t/pragma/warn/toke b/t/pragma/warn/toke index 1f8b142..2c9433b 100644 --- a/t/pragma/warn/toke +++ b/t/pragma/warn/toke @@ -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 --- 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; } }