Functions with a (_) prototype should behave as unary operators
Rafael Garcia-Suarez [Wed, 18 Oct 2006 17:40:57 +0000 (17:40 +0000)]
(which is not the case of functions with a (;$) prototype)

p4raw-id: //depot/perl@29041

toke.c

diff --git a/toke.c b/toke.c
index 0629099..4158e32 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -5403,7 +5403,7 @@ Perl_yylex(pTHX)
                        const char *proto = SvPV_const((SV*)cv, protolen);
                        if (!protolen)
                            TERM(FUNC0SUB);
-                       if (*proto == '$' && proto[1] == '\0')
+                       if ((*proto == '$' || *proto == '_') && proto[1] == '\0')
                            OPERATOR(UNIOPSUB);
                        while (*proto == ';')
                            proto++;