in reply to how to sum over rows based on column headings in perl

You have a problem in your data. Ignoring the first column, you have seven columns of headers but only six columns of actual data:

G1 G1 G1 G1 G2 G2 G3 W W M W W M W W W W W W ...

Update: I see now that anonymonk had already spotted this...

Update2: Corrected miscount

Replies are listed 'Best First'.
Re^2: how to sum over rows based on column headings in perl
by angerusso (Novice) on Jul 30, 2015 at 19:45 UTC
    Sorry I have updated my example data matrix and the updated my complete code which is causing me problems as I don't know how to update the hash outside the for loop over columns as I want to sum over rows, not columns. Any additional help will be greatly appreciated.