http://www.perlmonks.org?node_id=747340


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

The utf8:: functions can't be loaded by use utf8; since that's a pragma. I guess universal.c was a speedier alternative to making a module just to expose the utf8:: functions.

Replies are listed 'Best First'.
Re^2: Will the real Internals module please stand up?
by ysth (Canon) on Mar 01, 2009 at 20:06 UTC
    They could have been included in the module, the same way that there are utility functions in the charnames pragma that you can load without triggering the pragma behavior via "use charnames ()" or "require charnames".

    So either it was just a "speedier alternative", as you say, or it was desired that the module not need to be loaded. I can't guess which.

      One reason to put things in universal.c is it allows you to use these functions in miniperl. If they are used by things that are run by miniperl or they are used to test perl then they need to be available early. Another reason is that functions are used to implement parts of perls internals, and therefore need to be around. An example is some of the re:: routines that are used to implement named captures. They need to be usable without loading the re dll, which also contains a full debugging enabled version of the regex engine.

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