Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Any way to enumerate CORE::GLOBAL members?

by foolishmortal (Novice)
on Sep 12, 2009 at 02:43 UTC ( [id://794879]=perlquestion: print w/replies, xml ) Need Help??

foolishmortal has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,

Is there any way to get perl to spit out the names of all builtin functions/vars?

I am thinking of something along these lines (which doesn't yield anything):

for my $func (keys %main::CORE::GLOBAL::) { say $func; }
Thanks for any insight you can provide.

Replies are listed 'Best First'.
Re: Any way to enumerate CORE::GLOBAL members?
by jbt (Chaplain) on Sep 12, 2009 at 03:37 UTC
Re: Any way to enumerate CORE::GLOBAL members?
by ikegami (Patriarch) on Sep 12, 2009 at 03:38 UTC

    No. For starters, they aren't functions. They are operators. There's no difference between "print" and "+" except in the arguments they take and the operation they perform.

    As for variables, it depends on what you mean by special. If you mean those in perlvar, they are in perlvar.

Re: Any way to enumerate CORE::GLOBAL members?
by Khen1950fx (Canon) on Sep 12, 2009 at 04:24 UTC
    I couldn't find an easy way using CORE::GLOBAL, but here is an easy way to get perl to spit out functions. Using Pod::Functions, enter this on the command line for example ( macosx ):

    perl /sw/lib/perl5-core/5.8.8/Pod/Functions.pm
Re: Any way to enumerate CORE::GLOBAL members?
by blokhead (Monsignor) on Sep 12, 2009 at 19:43 UTC
    A convenient listing of all builtins/keywords can be found in B::Keywords. In your case, you'll probably want @B::Keywords::Functions.

    blokhead

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://794879]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2024-03-28 10:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found