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:
I always get this error message:foreach my $itemcode (keys %inventory) { my $quantity = $inventory{$itemcode}[2]; if ( $quantity > 0 )
Right now, I have all of the use strict; statements commented out.
Any suggestions on how to correct this error?
Thanks.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: use of unitialized value
by robartes (Priest) on Oct 20, 2003 at 18:10 UTC | |
by madaket (Novice) on Oct 20, 2003 at 18:53 UTC | |
Re: use of unitialized value
by ptkdb (Monk) on Oct 20, 2003 at 19:04 UTC | |
Re: use of unitialized value
by dragonchild (Archbishop) on Oct 20, 2003 at 18:17 UTC | |
Re: use of unitialized value
by Not_a_Number (Prior) on Oct 20, 2003 at 19:14 UTC |