in reply to RE: RE: Nesting... or something.
in thread Nesting... or something.

what you want is not possible, because you can't have a single hash key retrieve both a plain scalar and a hash reference.
my %hash; $hash{foo} = 'bar'; # the following replaces the value of $hash{foo} with a hash reference $hash{foo}{bar} = 'baz'; # the following is equivalent $hash{foo} = { bar => 'baz' };
so, if someone did: builder('baz', [ 'foo', 'bar' ]); it would wipe out the effect of: builder('bar', [ 'foo' ]);

Replies are listed 'Best First'.
RE: RE: RE: RE: Nesting... or something.
by jettero (Monsignor) on Jun 05, 2000 at 09:52 UTC
    What I wanted was possible.
    sub build_args() {  # Based on fastolfe's answer
        my $data = shift;
        my $ptr = \%The_Big_Hash;
        my $me  = pop @_;
        foreach my $host (@_) {
            $ptr = $ptr->{$host}{deps};
        }
        $ptr->{$me}{args} = [ @{ $data } ];
        $ptr->{$me}{deps} = {};
    }