First suggestion(not having seen any more of your code), turn 'use strict' back on.
Then painstakingly correct everything it points out.
"Use of uninitialized value" is a -w warning, but typically not a fatal error(depending on your point of view of course).
You could use the 'ptkdb' debugger and set a breakpoint at your 'if' statement and set its condition do "!defined $quanity". The debugger will stop the program when that statement would generate that warning. That will allow you to see the 'offending member' in your hash. You can use the default perl debugger to do the same thing with the command: 'b <lineno> !defined $quantity'.
Check the code that populates that hash.