in reply to Re^2: Installing Module::Info 0.35 for Strawberry Perl 5.22.0
in thread Installing Module::Info 0.35 for Strawberry Perl 5.22.0

I didn’t realise that Win32 is a “magic” module — that explains a great deal.

Unfortunately, that's only half of the story.

Win32 ports of Perl implemented some functions in core, but in the namespace Win32, so they were available without having to load the Win32 module, and without loading the module. Other functions were implemented only in the Win32 module and were available only after that module had been loaded.

That's not very clean, but at least it was documented by marking all in-core functions with [CORE] in the documentation of the Win32 module.

Now (and that's new to me, too, just reading the documentation Win32CORE and Win32), the functions marked with [CORE] are no longer in-core, they are replaced with stubs that implicitly load the Win32 module.


I don't think the stubs are much cleaner than having the functions in core. But at least it allows to update the Win32 code independant from perl. I would have prefered extending the heuristics for "(perhaps you forgot to load "%s"?)" to detect when a [CORE] function was called without having loaded the Win32 module. This way, perl -E "say Win32::OSVersion()" would result in the error message "Undefined subroutine &Win32::OSVersion called (perhaps you forgot to load "Win32"?)  at -e line 1." instead of just "Undefined subroutine &Win32::OSVersion called at -e line 1.". But that would have caused badly written old scripts to complain or crash, and as we all know, that's a no-go for new perl versions. Well, except for given/when and the smartmatch operator.

The difference between Win32 [CORE] and Win32 non-[CORE] functions never made sense for me. Win32::BuildNumber() is specific for ActiveState Perl and is by definition not portable, not even to other Win32 ports. All other functions could be in an external XS module, as they are mostly thin wrappers for Win32 API calls.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^4: Installing Module::Info 0.35 for Strawberry Perl 5.22.0
by BrowserUk (Patriarch) on Jun 28, 2015 at 21:09 UTC
    Unfortunately, that's only half of the story.

    That sounds like you are attributing the failure to install a module, because of the failure of a second module, on the existence of a 3rd module, that isn't used by either of the first two?

    And despite the fact that the first module installs & runs perfectly, if you remove the second module from the picture. How can you hold the third module responsible?


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
    I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!