in reply to HASH HELP PLEASE

Also have a look at Text::Table.

As for capturing the data, I think just a HoH will suffice. Your matrix presentation suggests that for each query and subject only one percent value is possible. In pseudo code:

my $matrix; my %seen_queries; for each row in the excel file: my ($query, $subject, $percent) = values from the excel row $matrix->{$subject}->{$query} = $percent; $seen_queries{$query} = 1; end for
And to display the matrix:
use Text::Table; my @cols = keys %seen_queries; my $tb = Text::Table->new(@cols); for my $subject (keys %$matrix) { $tb->load( [ @{$matrix->{$subject}}{@cols} ] ); } print $tb;
This code demonstrates: Also, when writing this code I had to decide if I wanted to store the data as $matrix->{$subject}->{$query} or $matrix->{$query}->{$subject}. The latter organization would still work but would have made the table display code slightly more complex. Here's how it would have worked out:
use Text::Table; my @cols = keys %$matrix; my $tb = Text::Table->new(@cols); for my $subject (keys %seen_subjects) { my @vals; for my $query {@cols) { push(@vals, $matrix->{$query}->{$subject}); } $tb->load( [ @vals ] ); }
The hash %seen_subjects would be constructed in the reading phase just like %seen_queries but with $subject as the hash parameter.