[ABE.pm] hashes of hashes and more

Faber J. Fedor faber at linuxnj.com
Fri May 9 12:41:15 PDT 2008


I want to build a tree like this:

$self->{tree}
     |
     -- node1
     |   |
     |   -- @children[ node3, node4]
     |
     -- node2
         |
         -- @children[node5, node6]

I thought adding node3 as a child of node1 would be

my $var = 'node1'
push( @{ $self->{tree}->{$var}->{'children'} }, 'node3');

put I keep getting 

Can't use string ("node1") as a HASH ref yada yada yada

Suggestions?

-- 
 
Regards,
 
Faber Fedor
President
Linux New Jersey, Inc.
908-320-0357
800-706-0701

http://www.linuxnj.com





More information about the ABE-pm mailing list