in reply to combining elements of arrays

I'm not sure why you're making it so complicated. Maybe I'm missing something.
my %q_u; open PAGELOG, "< page_log" or die "unable to open pagelog for read: $!\n"; while (<>) { chomp; my( $queue, $user, $jobid, @rest ) = split; defined $jobid or next; $q_u{$queue}{$user}{'jobids'}{$jobid}++; $q_u{$queue}{$user}{'npages'}++; } close PAGELOG; for my $queue ( sort keys %q_u ) { print "[$queue]\n"; for my $user ( sort keys %{ $q_u{$queue} } ) { my $nj = keys %{ $q_u{$queue}{$user}{'jobids'} }; my $np = $q_u{$queue}{$user}{'npages'}; print " [$user]\n"; print " $nj jobs - $np pages total\n"; } }

Replies are listed 'Best First'.
Re^2: combining elements of arrays
by tcf03 (Deacon) on May 12, 2005 at 13:27 UTC
    Excellent! Thanks - I usually complicate things like this.

    Ted
    --
    "Men have become the tools of their tools."
      --Henry David Thoreau