Wags helped me with the last problem (though we are still unsure of the
reason for the behavior).

This round I have encountered another similar problem.  The code sample
works for printing out the scalars, but when I attempt to print out the
arrays instead the size of the arrays are printed, causing no end to
confusion.

If I print $MIB_TREE{$object}->children i get an array reference, so i try
to dereference it but then I can only get the size.

Any ideas ?

(Perl guru's please see the earlier note with the similar subject line to
see if you can help with that problem as well).

Truly confused,




#!/usr/bin/perl -w
use strict;
use Parse::RecDescent;
use Class::Struct;
select ( STDOUT );
$| = 1;

# my $wRX               = "\[\\w\\-\]";
# my $commentRX = qr/^--/;

struct Object => {
        name    => '$',
        id      => '$',
        children => '@',
};

my %MIB_TREE;

my $node = Object->new();
$node->name("Murray");
$node->id("ID3148");
@{$node->children} = ("Craig", "Scott", "Cara");

$MIB_TREE{$node->name} = $node;

$node = Object->new();
$node->name("CRAIG");
$node->id("ID0281");
@{$node->children} = ("NA");

$MIB_TREE{$node->name} = $node;

foreach my $object ( keys %MIB_TREE )
{
        print $MIB_TREE{$object}->name."\n";
        print $MIB_TREE{$object}->id."\n";

        print @{$MIB_TREE{$object}->children}."\n";
}


-----------------------------------------
Craig Moynes
IBM Global Services, Canada
[EMAIL PROTECTED]




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

Reply via email to