From: Jonathan S. <gel...@ge...> - 2002-01-30 20:31:52
|
On Wed, 30 Jan 2002, Joseph F. Ryan wrote: > > Tell me; how many of you use constants for configuration stuff in your own > Perl code? It's NEVER done. The constant pragma isn't even used much, and > that is in the core. > I would say that NEVER is a little strong perhaps. For myself I am unlikely to ever put configuration in the code itself, and where I do it is likely to be in some Config.pm with accessor methods to the configuration items, but 'constant' does have its place when you are dealing with stuff that really is constant like 'PI' or 'TOES_PER_FOOT'. We all use manifest constants from modules like Socket or Fcntl and these are superficially similar to what 'constant' does (Ok, it gets a little different if you look too closely under the bonnet - but hey, don't do that :) What I really want to discuss is the configuration mechanism in its entirety: with the exception perhaps of the message storage mechanism employed by wwwboard, the configuration-by-editing-the-program-file is one of the nastiest legacies from the original code that we seem compelled to keep; but this, as we have discussed already, is more likely to lead to error and confusion in the hands of a non-programming 'webmaster' than anything else. OK, its agreed that we have to support the possibility of the end-user upgrading their FormMail.pl or whatever by simply uploading a new program file with the configuration details changed, but are these people really that useless that they can't edit and upload a separate configuration file ? I'm thinking that for the Green field sites that perhaps we should have an 'NMS COnfigurator' which, whilst it needs to be edited once itself, will infact write the configuration of all the other NMS programs ... Train Journey over ... discuss :) /J\ -- Jonathan Stowe | <http://www.gellyfish.com> | This space for rent | |