Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Which are perl-internal subroutines?

by diotalevi (Canon)
on Nov 18, 2007 at 02:33 UTC ( [id://651483]=note: print w/replies, xml ) Need Help??


in reply to Which are perl-internal subroutines?

I compiled a list once. This changes over time of course. You won't be able to expect to write a list once and then not update it as new things show up on CPAN or as perl changes.

# A dictionary of stuff that can show up in UNIVERSAL. our @UNIVERSAL_METHODS = ( # core perl qw( isa can VERSION ), # core perl 5.9.4+ 'DOES', # UNIVERSAL.pm 'import', # UNIVERSAL/require.pm qw( require use ), # UNIVERSAL/dump.pm qw( blessed dump peek refaddr ), # UNIVERSAL/exports.pm 'exports', # UNIVERSAL/moniker.pm qw( moniker plural_moniker ), # UNIVERSAL/which.pm 'which', # SUPER.pm qw( super SUPER ), );

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Replies are listed 'Best First'.
Re^2: Which are perl-internal subroutines?
by Tobiwan (Beadle) on Nov 19, 2007 at 06:57 UTC
    Thanks a lot. I'll check these methods. I don't need the all-time-complete-list of that subroutines, but as more I can identify as better it is.
Re^2: Which are perl-internal subroutines?
by Tobiwan (Beadle) on Nov 19, 2007 at 23:46 UTC
    Hi,

    I've check all your described methods. All these methods are polluted by modules which are not needed or automatical loaded. So I only add the VERSION-subroutine to my list.

    I don't want to check the attributes for all methods, other modules provide. Only for methods which are provided by pure perl.

      The list for core perl is everything from UNIVERSAL.pm and up. SUPER is also in the core and is frequently used. The other things are still somewhat uncommon. You would be wrong to think that only 'VERSION' is the available method. When I load my perl up with no modules at all and look at in the debugger I get four methods.

      perl -dea DB<1> m main via UNIVERSAL: DOES via UNIVERSAL: VERSION via UNIVERSAL: can via UNIVERSAL: isa DB<2> q

      ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

        Hi,

        I don't care about frequently use modules, because if someone use a module, he has to take care about side effects for himself.

        The UNIVERSAL-methods can() and isa() are still in my list. But for curiosity: what is the DOES() method? Where can I find documentation about ist? I've only perl 5.8x so I cant reproduce it.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (2)
As of 2024-04-26 03:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found