Subject: | Add some more keywords |
Date: | Fri, 22 Oct 2010 22:36:55 +0200 |
To: | bug-B-Keywords [...] rt.cpan.org |
From: | Zsbán Ambrus <ambrus [...] math.bme.hu> |
Dear maintainer of the B::Keywords module,
I collected perl keywords for a soon to be released module
(Object::Import, snapshot at
"http://www.math.bme.hu/~ambrus/pu/objexport.tgz"), and B::Keywords
was great help in this. I'd like to thank you for the module.
However, there are some more keywords you might want to add to the
module. I'm not quite sure what your definition of keyword is
(there's probably no good single definition), so I don't send a patch,
instead you'll have to decide what to add where. (You could also read
the source of my module directly in case I miss something here.)
Firstly, *_ is a special filehandle (documented in perlfunc under
stat). DATA is also a special filehandle in any package. Also, the
following three are special filehandles aliased to their uppercase
variants (deprecated): stdin stdout stderr
Secondly, all of the following are special functions sometimes called
by the perl core, namely for tieing or PerlIO::via (or both of those)
or threads. BINMODE CLEAR CLEARERR CLONE CLONE_SKIP CLOSE DELETE EOF
ERROR EXISTS EXTEND FDOPEN FETCH FETCHSIZE FILENO FILL FIRSTKEY FLUSH
GETC NEXTKEY OPEN POP POPPED PRINT PRINTF PUSH PUSHED READ READLINE
SCALAR SEEK SETLINEBUF SHIFT SPLICE STORE STORESIZE SYSOPEN TELL
TIEARRAY TIEHANDLE TIEHASH TIESCALAR UNREAD UNSHIFT UNTIE UTF8 WRITE
Thirdly, many functions whose name starts with a left parenthesis are
used by operator overloading, and so is the package scalar
${$pkg"::()"}. You can find out about these from the source of the
overload pragma.
Fourth, the functions &import and &unimport are called by builtins
(which is especially ironic since import is already mentioned at one
point in the source code of B::Keywords, but not as a keyword).
Fifth, you might now want to count "continue" as a function instead of
a bareword because it now has a second meaning, but with qw"lock exp
no" in the list of barewords and "format" in the list of functions I'm
not quite sure about the distinction you use. Incidentally, it would
be useful to have a list of builtin functions that are overridable by
importing a sub or by "use subs" available separately, but I don't
know a quick way to compile that list so I can't help you there.
Sixth, the following four are methods in UNIVERSAL: can isa DOES
VERSION. Also, the following are variables or functions used by
Exporter (some internal), which is almost as good as being keywords,
for you mustn't use them for any other purpose in any package that isa
Exporter, which is quite common: @EXPORT @EXPORT_OK @EXPORT_FAIL
@EXPORT_TAGS _push_tags _rebuild_cache as_heavy export export_fail
export_fail_in export_ok_tags export_tags export_to_level heavy_export
heavy_export_ok_tags heavy_export_tags heavy_export_to_level
heavy_require_version require_version
Ambrus