in reply to Re^3: Package Variables
in thread Package Variables

I see your point, but still why not warn me? Perl warns me if I declare the same variable name in the same scope even though I may know what I'm doing. It seems like the way the perl warnings pragma operates.

It's not like I am doing something hard to predict like overriding some 3rd party CPAN module. This is an expected, core perl module no?

Replies are listed 'Best First'.
Re^5: Package Variables
by Anonymous Monk on Mar 28, 2011 at 07:23 UTC
    It isn't loading your Config.pm, so how would perl know to warn you?

    If on the other hand, you knew enough to use lib or -I to get perl to load your Config, you should know enough not to use already used names

    You could easily write something to warn you, using Module::Find, Module::CoreList, Module::Mapper, Module::Finder, Module::Locate, Devel::Modlist, Module::Which, Module::Which::List, so that

    use warnings::modulecollision;
    would warn you, but I don't know of any programming language that would try to do that by default, but I don't know of any languages that try to do this at all :)

    People seem to catch on pretty quick, its like house numbers, you can have many with the same number, as long as the street names are different :)

      heh. But if I did try and build a new house with the same number and the same street, I'm pretty sure I would get a "warning" from it's current owner. =o)

      I'm very grateful for the help -- it's a mistake on my part that I'll be more wary of in the future.