Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Variable Declaration

by tstock (Curate)
on Oct 19, 2001 at 16:52 UTC ( [id://119968]=note: print w/replies, xml ) Need Help??


in reply to Variable Declaration

Either way (pakage or function file) sounds good, but I would make a configuration file. There are several modules to help ou with that on CPAN.

In addition to database information, I place paths, filenames, debug levels and anything else that is static in there.

You could also declare a bunch of constants in a file to be required.

Tiago

Replies are listed 'Best First'.
Re: Re: Variable Declaration
by Voronich (Hermit) on Oct 19, 2001 at 17:50 UTC

    My god. NO!!! It's the dreaded "me too" post!

    I like a combination of these ideas.

    Maintain a module that will give you the open handle, that uses a config file to grab it. That way you can play all the games you want with specifying config files and datasources hot.

    We have a bunch of code that we all of a sudden needed to link to multiple databases (*sniff* *sniff* legacy system? Yep, the tracks are still warm.) And that approach saved our collective posteriors.


    $.02

    - V

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (1)
As of 2024-04-24 14:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found