This is more a question of what is considered good style then functional programming. I have a perl module/class that is dependant on about a dozen 'global' variables being imported from a "config.pm". All other modules in this application use this same "config.pm" to get at these 'global' variables as well. Is this considered acceptable style or should all code (especially classes) be totaly decoupled? I don't suppose it would be any great hardship to pass a ref of a hash that includes all these variables to every single function call in this application but that doesn't seem to tidy to me. An thoughts/criticism one way or the other?
On a related topic... If I declare a scalar as a constant in a module then export that scalar will it remain a constant? I'm not so much worried about it remaining constant as I am get compile time replacement in any script/module that has that scalar exported into it. Does that make sense to anyone else?