in reply to Re^3: Need to find a more efficient way to write if/elsif in loop
in thread Need to find a more efficient way to write if/elsif in loop

0 .. $col_length;

Should maybe be
    0 .. $col_length-1;
based on OPed code.