Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Will the real Internals module please stand up?

by ysth (Canon)
on Mar 01, 2009 at 19:39 UTC ( #747336=note: print w/ replies, xml ) Need Help??


in reply to Will the real Internals module please stand up?

Undocumented things in universal.c should not be depended on; they should only be used by core modules. They aren't documented on purpose, to allow them to be changed whenever and however necessary. For those purposes, the code is good enough documentation.


Comment on Re: Will the real Internals module please stand up?
Re^2: Will the real Internals module please stand up?
by ikegami (Pope) on Mar 01, 2009 at 20:30 UTC

    Some are documented

    UNIVERSAL::isaimplied
    UNIVERSAL::canimplied
    UNIVERSAL::DOESimplied
    UNIVERSAL::VERSIONimplied
     
    version::newundocumented availability
    version::qvundocumented availability
    version::booleancompletely undocumented
    version::vcmpcompletely undocumented
    version::noopcompletely undocumented
    version's UNIVERSAL::VERSION overrideundocumented availability
     
    utf8::is_utf8documented
    utf8::validdocumented
    utf8::encodedocumented
    utf8::decodedocumented
    utf8::upgradedocumented
    utf8::downgradedocumented
    utf8::native_to_unicodecompletely undocumented
    utf8::unicode_to_nativecompletely undocumented
     
    Internals::SvREADONLYcompletely undocumented
    Internals::SvREFCNTcompletely undocumented
    Internals::hv_clear_placeholderscompletely undocumented
    Internals::hash_seedcompletely undocumented
    Internals::rehash_seedcompletely undocumented
    Internals::HvREHASHcompletely undocumented
     
    PerlIO::get_layersundocumented availability
     
    re::is_regexpundocumented availability
    re::regnameundocumented availability
    re::regnamesundocumented availability
    re::regnames_countundocumented availability
     
    Tie::Hash::NamedCapture::undocumented availability

    The table applies to 5.10.0. I omitted methods except those in UNIVERSAL (since those have a global effect).

    Legend:

    documentedThese functions are documented as always available.
    impliedThe documentation for these functions implies they are always available.
    undocumented availabilityThese functions are documented, but their availability isn't.
    completely undocumentedThe documentation of the modules for these functions don't mention them.

    Interestingly, version claims to override UNIVERSAL::VERSION, but there is only one function. The "override" is always in effect.

    Interestingly, the following bindings are absent:

    • re::regmust
    • re::regexp_pattern

      What do you mean about "bindings are absent"?

      Most of this stuff, in particular availability, is not documented directly for a reason. So for instance Tie::Hash::NamedCapture is used to implement named captures. It is loaded automagically by the internals when you do a $+{foo} style lookup. It uses a bunch of the re:: functions, which are exposed via universal because they are then compiled into the core executable and thus do not require an additional library to be loaded. Now I could have implemented the entire thing without using any perl level modules or exposing any subs, but that would have limited the options available to the programmer which I felt was not the Perl way.

      ---
      $world=~s/war/peace/g

        I just saw this now for the first time.

        What do you mean about "bindings are absent"?

        Don't know.

        re::regexp_pattern is defined in 5.10.0's universal.c and it's bound to the Perl namespace.

        re::regmust isn't defined in 5.10.0's universal.c, so why was it mentioned?

        Maybe I was looking at the wrong file version?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (12)
As of 2014-12-19 17:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (90 votes), past polls