#!/usr/local/bin/perl -- use CGI ':standard'; print header, start_html('Inventory Answer'); #Inventory, PartNo, Item, NumInStock, Price $PRTNO = 0; $ITEM = 1; $NUM = 2; $PRICE = 3; @Inventory = ( ['AC1000', 'Hammers', 122, 12], ['AC1001', 'Wrenches', 344, 5], ['AC1002', 'Hand Saws', 150, 10], ['AC1003', 'Screw Drivers', 250, 2]); $pick = param('item'); $i = 0; #print $Inventory[$#Inventory] + 1; while ($i < 4) { if ($i == $Iventory[$PRTNO]) { print "Yes we have $Inventory[$pick][$ITEM] in stock.", br; print "We have $Inventory[$pick][$NUM] presently in stock", br; print "How many would you like to order?"; } $i++; } print end_html;