http://qs321.pair.com?node_id=300684

madaket has asked for the wisdom of the Perl Monks concerning the following question:

I have a hash of lists (called inventory) that contain an itemcode (the key), description, price, and quantity.

When I try to find out if the quantity is greater than zero:

foreach my $itemcode (keys %inventory) { my $quantity = $inventory{$itemcode}[2]; if ( $quantity > 0 )
I always get this error message:
Use of uninitialized value in numeric gt (>) at (the if statement line).

Right now, I have all of the use strict; statements commented out.

Any suggestions on how to correct this error?

Thanks.