in reply to Re^2: "possible typo" warnings in modules
in thread "possible typo" warnings in modules

Thanks again.   I actually looked it up in the sources now (guess I should've done so earlier), and I presume it's this part in Perl_gv_check(), gv.c:1251:

/* performance hack: if filename is absolute and it's a standa +rd * module, don't bother warning */ #ifdef MACOS_TRADITIONAL # define LIB_COMPONENT ":lib:" #else # define LIB_COMPONENT "/lib/" #endif if (file && PERL_FILE_IS_ABSOLUTE(file) && (instr(file, LIB_COMPONENT) || instr(file, ".pm"))) { continue; } CopLINE_set(PL_curcop, GvLINE(gv)); #ifdef USE_ITHREADS CopFILE(PL_curcop) = (char *)file; /* set for warning */ #else CopFILEGV(PL_curcop) = gv_fetchfile(file); #endif Perl_warner(aTHX_ packWARN(WARN_ONCE), "Name \"%s::%s\" used only once: possible typo", HvNAME_get(stash), GvNAME(gv)); ... with PERL_FILE_IS_ABSOLUTE being defined as (for my platform): #define PERL_FILE_IS_ABSOLUTE(f) (*(f) == '/')

So, I removed the .pm extension (the other two criteria, i.e. /lib/ and absolute path, don't apply in my case -- I even checked with strace(1) what it's really loading). (Update: actually, taking a closer look, I see it's PERL_FILE_IS_ABSOLUTE(file) && ..., so the other two shouldn't apply anyway...)

Interestingly, still none of the following do issue the warning:

require "WarnMe"; --- do "WarnMe"; --- my $code = join '', <DATA>; eval $code; __DATA__ my $val = $Some::Nonexistent::Pkg::variable; --- eval 'my $val = $Some::Nonexistent::Pkg::variable';

Well, I guess some other hack is playing tricks on me...   Anyway. :)