Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Style: buried variables or double referencing?

by rjbs (Pilgrim)
on Aug 20, 2005 at 20:00 UTC ( [id://485425]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://485425]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 09:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found