Time to go and play with hashes for a while! Start with the simplest imaginable hash
my %hash; $hash{A} = 1;
and dump it. Then add additional data, then additional levels, and get a feel for what the operations are doing.
Just wanted to chime in and say, I think this is a super great idea!
Stuart, I think you're close to getting your head around all of this, but in talking with you last week and then watching your conversation with Rob today, it's clear that you are getting tripped up by the hashes and references (in Perl, references are required for multidimensional hashes).
Rob's really got the right idea here, go back to the basics and see how all this is working, then it should slide into place for you. Data::Dumper can really help this along, just like Rob said.
Expanding on his idea a little, start with something like the following. See if you can run through how this is working. This is really just a simplified version of the things you are trying, minus references.
Good luck and come back if you run into more questions.
James
#!/usr/bin/perl
use strict; use warnings;
use Data::Dumper;
my %test; $test{Count} = 1; print "First:\n", Dumper(\%test);
$test{Count}++; print "\nAfter ++:\n", Dumper(\%test);
{ # a block of code, for scope my $key = 'Count'; $test{$key}++; } # block ends, $key ceases to exist print "\nAfter ++ via \$key:\n", Dumper(\%test);
$test{$_}++ foreach 'A'..'Z'; print "\nAfter 'The Seen ++ Trick':\n", Dumper(\%test);
__END__;
First: $VAR1 = { 'Count' => 1 };
After ++: $VAR1 = { 'Count' => 2 };
After ++ via $key: $VAR1 = { 'Count' => 3 };
After 'The Seen ++ Trick': $VAR1 = { 'S' => 1, 'F' => 1, 'T' => 1, 'N' => 1, 'K' => 1, 'Y' => 1, 'E' => 1, 'V' => 1, 'Z' => 1, 'Q' => 1, 'M' => 1, 'C' => 1, 'L' => 1, 'A' => 1, 'J' => 1, 'O' => 1, 'W' => 1, 'X' => 1, 'P' => 1, 'B' => 1, 'H' => 1, 'D' => 1, 'R' => 1, 'Count' => 3, 'I' => 1, 'G' => 1, 'U' => 1 };
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]