Greetings,
friedo++ on how to solve this particular problem so I will point you at some helpful docs.
perlref (about anonymous and referenced structures) &
Dumpvalue or
Data::Dumper (both of which will help make sure you are creating what you think you are creating).
quick usage example:
#!/usr/bin/perl -w
use strict;
use Dumpvalue;
print "dumping data structure\n";
dump_ref(\$reference_to_your_nested_data_structure);
exit;
#the sub.
sub dump_ref
{
my $d = new Dumpvalue;
my $ref = shift;
$d->dumpValues($ref);
}
"I do not feel obliged to believe that the same God who endowed us with sense, reason and intellect has intended us to forego their use." -Galileo