develooper Front page | perl.fwp | Postings from March 2002

Re: Symbols in CORE?

Thread Previous | Thread Next
From:
Rafael Garcia-Suarez
Date:
March 1, 2002 03:01
Subject:
Re: Symbols in CORE?
Message ID:
slrna7uno3.cc6.rgarciasuarez@rafael.example.com
F . Xavier Noria wrote in perl.fwp:
> Is there a way to list the symbols in the CORE package?

Symbols in the CORE "package" are (currently) the Perl keywords. E.g. :

    $ perl -le 'print 1 CORE::x 3'
    111

    $ perl -le '$_=shift;CORE::y/a/b/;print' bar
    bbr

Note that this is not documented.

To have the list of the perl keywords, a way to do it is to open the
file keywords.h that must be installed somewhere on your disk
(e.g. mine is at /usr/lib/perl5/5.6.0/i386-linux/CORE/keywords.h)
and parse it.

Have fun!

-- 
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/ / http://lyon.pm.org/
There's always something that's known to be painfully broken, for some
definitions of pain and broken. -- Jarkko Hietaniemi

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About