in reply to Use of uninitialized value

You can try:
if ( exists ( $spec_hash{$exch}{$symbol} ) and $spec_hash{$exch}{$symbol} != 1 ) {
or
if ( ($spec_hash{$exch}{$symbol}//0) != 1 ) {
depending on how you want to handle the non-existing hash item.