S> I have a systems hash that contains the type of system
S> as keys and the name of the machines as values:

S> %systems = (
S>    sgi   => ["sgi1", "sgi2"],
S>    linux => ["linux1", "linux2"],
S>    dec   => ["dec1", "dec2"]
S> };

S> Now, each type of system has default values like an
S> email help address, shell used, users home directory,
S> etc.  Something like this:

S> %default = (
S>     sgi   => ["sgi-help","/bin/csh","/home"],
S>     linux =>
S> ["someaddress-help","/bin/bash","/usr/home"],
S>     dec   => ["help-desk","bin/kcsh","/usr1/home"]
S> );

S> Is there a way to combine this last hash into the
S> first one or should I keep them separate?

there's loads of ways you could hold the data. the first one that
comes to mind looks like:

 %systems = (
    sgi   =>  { defaults => ["sgi-help","/bin/csh","/home"],
                machines => ["sgi1", "sgi2"],
              },
    linux =>  { defaults => ["someaddress-help","/bin/bash","/usr/home"],
                machines => ["linux1", "linux2"],
              },
    dec   =>  { defaults => ["help-desk","bin/kcsh","/usr1/home"],
                machines => ["dec1", "dec2"],
              },
             );

but it really depends on what it is you're doing with the data. you
want to design your data structure around the processing, rather than
designing a data structure that looks nice, but makes the code hard.

perhaps if you let us know what you want to do with it we might be
able to give some suggestions.

hth,
daniel


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to