You've got to clean it up a bit before it'll begin to make sense. Consider using a uniform practice of indentation. That will help in lining up brackets and parens, etc.
Also, that whole schpiel where you've got
my $a....
my $b....
my $c....
...and so on... that's not doing anything for you. You're declaring those variables within a narrow lexical scope, and they're passing out of scope before you ever use them. That's pointless. And even if it were, shouldn't that be an array of 26 elements rather than 26 named variables? ...and maybe a loop? Anytime you find yourself writing something 26 times, it's time to use a loop.
And even then, shouldn't those variable names have some meaning so a casual reader will know what they're for? The fact that they don't have meaningful names is probably why they've ended up not getting used anywhere else.
As for why your followup snippet doesn't work, it's missing a closing paren, which you could identify more easily if you were to adopt a uniform indentation practice.
Just some tips. I have no idea what the actual bug is, but there are underlying clarity problems that contribute to making it difficult for this piece of code to be developed, maintained, and understood.
|