###WRONG if ($chemical = $periodicTable[$i][1]) { #always activates ###RIGHT if ($chemical == $periodicTable[$i][1]) { #### my %periodic_table = ( 1 => {symbol=>'H', name => 'Hydrogen', weight => 1}, 2 => {symbol=>'He', name => 'Helium', weight => 4}, )