You're going to write some code to manage an inventory of items in a store. The inventory will be a hash reference containing the inventory items and their quantity.
Modify the InventoryManagement::create_inventory
subroutine, which takes an array reference of items as an argument, to return a newly created inventory hash reference, with keys being the item names and values being the quantity.
Modify the InventoryManagement::add_items
subroutine, which takes an inventory hash reference and an item array reference as arguments, to return a hash reference with the items added to the inventory.
Modify the InventoryManagement::remove_items
subroutine, which takes an inventory hash reference and an item array reference as arguments, to return a hash reference with the items removed from the inventory.
Item quantities should not go below zero.
Modify the InventoryManagement::delete_item
subroutine, which takes an inventory hash reference and an item name as arguments, to return a hash reference with the item deleted from the inventory completely.
Sign up to Exercism to learn and master Perl with 5 concepts, 83 exercises, and real human mentoring, all for free.