Just a quick note (I hope to have time to look further, but certainly not tonight nor tomorrow).

Please don't make up a brand new top-level name in the Perl module heirarchy. I see you used Statistics::Distributions, so you should be familar with some of the many, many modules to be found undef Statistics:: (search CPAN for statistics and see how many hits are properly named under this root name).

Doing a quick search to learn about "G statistics", it appears that a more canonical name is a G-test so I suggest you name your module Statistics::Gtest (unfortunately, hyphen isn't an appropriate character in a module name).

I don't think it makes sense to define the primary interface based on reading a file to get the matrix of data. If I have the data in a 2-dimensional Perl array, why should I have to write that out to a file in order to perform a G-test on it? I can see offering an option to read a data file in order to produce the 2-dimensional Perl array.

s/^\s*//; s/\s*$//; if ($_) { my @row = split(/\s+­/);

You can replace all of that with:

if( /\S/ ) { my @row= split ' ', $_;

(Note that I don't like making the $_ argument to split implicit.)

Thanks for writing this and for asking for a review. Looks well-written and useful.

- tye        


In reply to Re: RFC: Any and all comments welcome on style/technique in new module to calculate G statistic (::Gtest) by tye
in thread RFC: Any and all comments welcome on style/technique in new module to calculate G statistic by hilitai

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.