in reply to Re: Re: Nested Data Structure Help
in thread Nested Data Structure Help

Do you mean something like:
foreach my $class (sort keys %jobsClassKey) { my ($jobid, $status) = @{$jobsClassKey {$class}} {'jobid', 'st +atus'}; my $key = $status == 0 ? 'successfuljobs' : $status == 1 ? 'partiallysuccessful' : $status == 150 ? next : $status > 1 ? 'failedjobs' : next; push @{$masterClassHash {$class} {$key}} => $jobid; }

Abigail

Replies are listed 'Best First'.
Re: Re: Nested Data Structure Help
by blink (Scribe) on Jun 13, 2002 at 19:54 UTC
    Almost. Or, I'm doing somthing wrong. Here's what I'm doing to test the contents of each of the arrays:
    foreach my $key1 ( keys %masterClassHash ) { print "The class is $key1\n"; foreach my $key2(keys %{$masterClassHash{$key1}}) { print "\tstatus = $key2\n"; foreach (@{$masterClassHash{$key1}{$key2}}) { print "\t\tjobids = @_\n"; } } }

    This only yields one jobid per array, when multiple definitely exist.

    Thanks, everyone, for your help.

      You are printing @_, but the loop variable is $_.

      Abigail