in reply to Re: hash as an object property
in thread hash as an object property

Yes, I have sort of been able to do this (with arrays but not hashes as yet - do you have a code snippet?), but as there can be many services per node, how can I create hashes with arbitrary names ?

I am writing accessor methods and will build all this stuff up once I've got the basics working.

thanks.

Replies are listed 'Best First'.
Re: Re: Re: hash as an object property
by davorg (Chancellor) on Oct 02, 2001 at 13:09 UTC

    Perhaps code a bit like this:

    my @services = qw(smtp http ssh); # list of services foreach (@services) { # Somehow get the details for the given service on # the given node. Here I'm assuming the existance of # a function that returns the required hash. my %details = get_details($node, $_); $node->{$_} = \%details; }
    --
    <http://www.dave.org.uk>

    "The first rule of Perl club is you don't talk about Perl club."