Re: [Perl-unix-users] dereferencing hash of hashes

2005-04-04 Thread Martin Moss
print "my hash value is '".$INST{DEV}->{dbhost}."'\n"; --- [EMAIL PROTECTED] wrote: > With this new structure, how would I dereference the > hash to return the text value instead of the hash > reference? > > use strict; > > my %INST= ( > DEV => { >fullname=> "DEVELOPMENT", >

[Perl-unix-users] dereferencing hash of hashes

2005-04-04 Thread listmail
With this new structure, how would I dereference the hash to return the text value instead of the hash reference? use strict; my %INST= ( DEV => { fullname=> "DEVELOPMENT", dbhost => { "erpd3" => { sshcon => "",

RE: [Perl-unix-users] hash of hashes

2005-04-04 Thread Thomas, Mark - BLS CTR
> 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.

RE: [Perl-unix-users] hash of hashes

2005-04-04 Thread Peter Eisengrein
> 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

Re: [Perl-unix-users] hash of hashes

2005-04-04 Thread Martin Moss
--- [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

Re: [Perl-unix-users] hash of hashes

2005-04-04 Thread listmail
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. - Original Message - From: Martin Moss <[EMAIL PROTECTED]> Date: Monday, April 4, 2

Re: [Perl-unix-users] hash of hashes

2005-04-04 Thread Martin Moss
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",

[Perl-unix-users] hash of hashes

2005-04-04 Thread listmail
my %INST= ( PROD => { fullname=> "PRODUCTION", dbhost => "proddb", dbsshcon=> "", webhost1=> "prodapp", websshcon1 => "", version => "8.1.7", }, DEV => { fullname=> "DEVELOPMENT", dbhost => "devdb",