From: Rafael Garcia-Suarez Date: Thu, 2 Nov 2006 13:51:21 +0000 (+0000) Subject: say() has the same syntax than print(), so forbid to override it X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e3e804c95d90aee717e2c436ebefa57599e64a70;p=p5sagit%2Fp5-mst-13.2.git say() has the same syntax than print(), so forbid to override it (like print()) p4raw-id: //depot/perl@29191 --- diff --git a/perl_keyword.pl b/perl_keyword.pl index 87332ee..f71c7d0 100644 --- a/perl_keyword.pl +++ b/perl_keyword.pl @@ -8,7 +8,7 @@ use warnings; my @pos = qw(__DATA__ __END__ AUTOLOAD BEGIN CHECK DESTROY default defined delete do END else eval elsif exists for format foreach given grep goto glob INIT if last local m my map next no our pos print printf - package prototype q qr qq qw qx redo return require s scalar sort + package prototype q qr qq qw qx redo return require s say scalar sort split state study sub tr tie tied use undef UNITCHECK until untie unless when while y); @@ -26,7 +26,7 @@ my @neg = qw(__FILE__ __LINE__ __PACKAGE__ and abs alarm atan2 accept bless length listen lcfirst localtime mkdir msgctl msgget msgrcv msgsnd ne not or ord oct open opendir pop push pack pipe quotemeta ref read rand recv rmdir reset rename rindex reverse readdir readlink - readline readpipe rewinddir say seek send semop select semctl semget + readline readpipe rewinddir seek send semop select semctl semget setpgrp seekdir setpwent setgrent setnetent setsockopt sethostent setservent setpriority setprotoent shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sprintf splice sqrt diff --git a/t/op/cproto.t b/t/op/cproto.t index 89bd555..a4dd691 100644 --- a/t/op/cproto.t +++ b/t/op/cproto.t @@ -187,7 +187,7 @@ rewinddir (*) rindex ($$;$) rmdir (_) s undef -say (;*@) +say undef scalar undef seek (*$$) seekdir (*$) diff --git a/toke.c b/toke.c index bc70534..4513c40 100644 --- a/toke.c +++ b/toke.c @@ -7393,7 +7393,7 @@ Perl_keyword (pTHX_ const char *name, I32 len, bool all_keywords) case 'a': if (name[2] == 'y') { /* say */ - return (all_keywords || FEATURE_IS_ENABLED("say") ? -KEY_say : 0); + return (all_keywords || FEATURE_IS_ENABLED("say") ? KEY_say : 0); } goto unknown;