Re: [ID 20011114.118] chop and chomp bind too tightly
Rafael Garcia-Suarez [Thu, 15 Nov 2001 08:57:06 +0000 (08:57 +0000)]
Message-Id: <slrn9v70s9.gqe.rgarciasuarez@rafael.kazibao.net>

chop() and chomp() are not real list functions,
so let's not have them overrideable.  (Casey will
be confused since in #7071 he patched the other way.)

p4raw-id: //depot/perl@13018

pod/perlfunc.pod
toke.c

index 174ff60..986c66e 100644 (file)
@@ -592,7 +592,7 @@ module:
 
 =item chomp VARIABLE
 
-=item chomp LIST
+=item chomp( LIST )
 
 =item chomp
 
@@ -626,7 +626,7 @@ characters removed is returned.
 
 =item chop VARIABLE
 
-=item chop LIST
+=item chop( LIST )
 
 =item chop
 
diff --git a/toke.c b/toke.c
index 1657f1e..64ef174 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -5330,12 +5330,12 @@ Perl_keyword(pTHX_ register char *d, I32 len)
            if (strEQ(d,"cos"))                 return -KEY_cos;
            break;
        case 4:
-           if (strEQ(d,"chop"))                return -KEY_chop;
+           if (strEQ(d,"chop"))                return KEY_chop;
            break;
        case 5:
            if (strEQ(d,"close"))               return -KEY_close;
            if (strEQ(d,"chdir"))               return -KEY_chdir;
-           if (strEQ(d,"chomp"))               return -KEY_chomp;
+           if (strEQ(d,"chomp"))               return KEY_chomp;
            if (strEQ(d,"chmod"))               return -KEY_chmod;
            if (strEQ(d,"chown"))               return -KEY_chown;
            if (strEQ(d,"crypt"))               return -KEY_crypt;