“Cache the data for other uses!”
dbmopen(%price_cache, "price_cache", 0644) or die …;
while ($line = <COST>) {
    . . .
    write;  # using format with $prod, $cost and $note
    $price_cache{$prod} = "$cost $note";
}
12