
"can't coerce array into hash" problem....
Quote:
> %t=undef;
^^^^^^^^
"Odd number of elements in hash assignment ..."
That's not likely to be the cause of your problem, though.
Quote:
> while..... { blah
> $t{$one[$i]}{$two[$i]}++;
> }
It might help if you actually investigated all those blahs and
dots; that's likely to be where the error is. See if you can produce
a small code segment that exhibits the problem you describe.
Quote:
> foreach my $key1 (sort keys %t) {
> foreach my $key2 (sort keys %{$t{$key1}}) {
> print FILE "$key1,$key2,$t{$key1}{$key2}\n";
> }
> }
What you've written here seems just fine; assuming $t{$key1} is
really a hashref in your initialization step:
% perl -wle '$t{$_}{$_}++ for 1..3; foreach $k1 (sort keys %t){
foreach $k2 (sort keys %{$t{$k1}}) { print "$k1,$k2,$t{$k1}{$k2}" }}'
1,1,1
2,2,1
3,3,1
--
Joe Schaefer "Always forgive your enemies; nothing annoys them so much."
-- Oscar Wilde