in reply to use of unitialized value
Try dumping the contents of $inventory{$itemcode} to see what's actually in it (using Data::Dumper:
That way, you can verify that the hash values contain what you think they contain.print Dumper($inventory{$itemcode}); # or even: print Dumper(\%inventory);
CU
Robartes-
In Section
Seekers of Perl Wisdom