> You might consider
> creating a config file that your script reads and builds the
> hash dynamically.
Agreed. And YAML is perfect for this kind of thing. Why?
- YAML is easily human-readable and editable (compared
to, say, XML)
- YAML can represent _any_ arbitrary Perl data structure.
> I think this is what you're trying to do
>
> But I'm not sure why? I'd only do this if you are
> expecting to have multiple configs for dbhost, e.g.
> devdb1, devdb2, devdb3... otherwise I'm not sure why
> you'd break down the structure this much...
>
Agreed. Also, by building it in a hard
--- [EMAIL PROTECTED] wrote:
> Martin, thanks for the response. Yes there are
> multiple servers and I tried to simplify the code
> since I wasn't providing a full script. This can
> also help me minimize hard coding throughout the
> script.
Avoiding hard coding - always a good thing... :-)
Whe
ay, April 4, 2005 12:21 pm
Subject: Re: [Perl-unix-users] hash of hashes
> I think this is what you're trying to do
>
> But I'm not sure why? I'd only do this if you are
> expecting to have multiple configs for dbhost, e.g.
> devdb1, devdb2, devdb3... otherwis
I think this is what you're trying to do
But I'm not sure why? I'd only do this if you are
expecting to have multiple configs for dbhost, e.g.
devdb1, devdb2, devdb3... otherwise I'm not sure why
you'd break down the structure this much...
DEV => {
fullname=> "DEVELOPMENT",
my %INST= (
PROD => {
fullname=> "PRODUCTION",
dbhost => "proddb",
dbsshcon=> "",
webhost1=> "prodapp",
websshcon1 => "",
version => "8.1.7",
},
DEV => {
fullname=> "DEVELOPMENT",
dbhost => "devdb",