in reply to Re^2: What happens when you load the same module twice?
in thread What happens when you load the same module twice?

File::Basename->import() won't be called, as Perl will try to call File::BaseName->import(), which doesn't exists so Perl will silently go on

You're describing the current behavior. His change, whatever other implications it may have, would not affect that.

Update: to clarify my statement for Anonymous Monk, I meant that adding the lc $name doesn't change whether use File::BaseName would call the right import routine, or not.

Replies are listed 'Best First'.
Re^4: What happens when you load the same module twice?
by Anonymous Monk on Feb 11, 2005 at 09:31 UTC
    His suggested change is to do a lowercase of the name, before doing the require. Which means that 'use File::Basename' and 'use File::BaseName' both reduce to requiring 'file::basename'. This means that duplicate checking in %INC gets captured.

    His change however didn't involve anything with changing the package name. He didn't suggest that 'use My::Module' should be equivalent to:

    BEGIN { require My::Module; # require does an lc of the name. (lc "My::Module") -> import; }
    Not that this would work. Because "file::basename::import" doesn't exist. Or are you suggesting that in dragonchilds "fix" package names are automatically lowercased as well? And that Perl's rule of "variable names are case sensitive" is to be changed to "lexical variable names are case senstive, but package variables are only case sensitive after the list colon"? I certainly didn't read that in his post.