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


in reply to use of unitialized value

Try dumping the contents of $inventory{$itemcode} to see what's actually in it (using Data::Dumper:
print Dumper($inventory{$itemcode}); # or even: print Dumper(\%inventory);
That way, you can verify that the hash values contain what you think they contain.

CU
Robartes-

Replies are listed 'Best First'.
Re: Re: use of unitialized value
by madaket (Novice) on Oct 20, 2003 at 18:53 UTC

    Hmmmm...
    The funny thing about this error message is that it happens whether there is a value in

    $inventory{$itemcode}[2]
    or not. The loop will generate the error in each iteration.
    The value is from a web page form input, so I thought the problem might be a string/number conversion, but the error message doesn't indicate that.