in reply to Array problems.

Others have pointed out the problem, but since you are comparing strings, eq is preferable to == (perlop)
if ( $chemical eq $periodicTable[$i][1] ) {

Also, consider using a hash for your table because it facilitates look-up.

UPDATE: CPAN is a handy resource: Chemistry::Elements

Replies are listed 'Best First'.
Re^2: Array problems.
by Discipulus (Canon) on Oct 28, 2014 at 13:12 UTC
    yes i was to fast and i thought was the number.. Obviously you are rigth.
    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.