sub total_inventory { my $data = shift; List::Util::sum(map {$_->{'Inventory'}} @$data); }