http://www.perlmonks.org?node_id=485425


in reply to Style: buried variables or double referencing?

Using Readonly::XS is nice and all, but I generally just use $NAMING_STYLE to tell the difference. It's not foolproof, but it's simple. (I'm sure that now I will go write code that breaks itself by assigning to a fake constant.)

What surprises me is that lack of mentions of putting those data into configuration. I'm not sure what kind of efficiency you're working for, but things like constants are often best moved to options or configuration. You can change them all you like without having to worry about rev'ing the code.

rjbs

Replies are listed 'Best First'.
Re^2: Style: buried variables or double referencing?
by punkish (Priest) on Aug 21, 2005 at 02:00 UTC
    > lack of mentions of putting those data into configuration

    holli did, above in Re^3: Style: buried variables or double referencing?. I really resonate with that suggestion. External config files, external templates... the rule is simple -- anything and everthing external to the code should be kept externally.

    --

    when small people start casting long shadows, it is time to go to bed