my $total; $total += $_->{'cost'} for @{$struct[3]{'baz'}[42]};