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.


Dave


In reply to Re^3: Flat file handling by davido
in thread Flat file handling by Win

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.