Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Which are perl-internal subroutines?

by diotalevi (Canon)
on Nov 18, 2007 at 02:33 UTC ( #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', # 'import', # UNIVERSAL/ qw( require use ), # UNIVERSAL/ qw( blessed dump peek refaddr ), # UNIVERSAL/ 'exports', # UNIVERSAL/ qw( moniker plural_moniker ), # UNIVERSAL/ 'which', # 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

    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 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

      ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊


        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?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (1)
As of 2021-10-18 21:32 GMT
Find Nodes?
    Voting Booth?
    My first memorable Perl project was:

    Results (75 votes). Check out past polls.