$hash_codes{$2},$5 # thus the useless use of hash element in void context. # there is also a useless use of scalar in void context as well. # you want $hash_codes{$2} = $5 # this is normal usage of => %hash = ( key1 => 'val1', key2 => 'val2' ); # which parses the same as: %hash = ( 'key1', 'val1', 'key2', 'val2' );