Hi all,

I really appreciate all of your input, especially BrowserUK. I'll try those changes, and see how it works. I agree - testing is critical.

One thing I figure I should describe is my naming convention. Yes, I know $major_frame_index and $minor_frame_index are long, but my reasoning was that $major or even $major_frame didn't seem descriptive enough for me. See, this is part of a larger app, in which I parse a large chunk of binary data (major frame), which is in turn made up of smaller chunks of data (minor frames). This resulted in two types of data for each type of frame, a numerical index and a chunk of binary data. The indices I use to reference their locations I called $major_frame_index and $minor_frame_index, and the chunks of data I have as scalar variables, $minor_frame and $major_frame. But writing this now makes me rethink my need to have store the binary chunks in variables... I don't have access to the rest of the code now, so can't say for sure.

But, assuming I would still need both the index and the binary chunk, is there a better way to name the variables?

-- Burvil


In reply to Re^2: Refactoring nested if block by bowei_99
in thread Refactoring nested if block by bowei_99

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.