I don't think Text::Table is the right tool for this application. It is only really useful for about a page worth of reading. Your first column will be 75 plus ? spaces alone. How do you plan to view the data? A couple of ideas that occured to me would be to create a comma separated values file or use Perl6::Form (like I did in Re: Formatting text, eg long lines). (You could wrap that long first column so it wouldn't run across the page).

With a comma separated values file format, you could open the files in Excel, (if you are on a Windows machine), and, if there is a large dataset, (more than a couple of pages), you can freeze the headers in Excel while still scrolling your data.

If your results will have many lines of results, with Perl6::Form, you could arrange headers to print after so many lines.

I say that about Text::Table because I'm guessing your results will be more than a couple of pages. If not, Text::Table would be OK.

If there are alot of rows to print, you might want to print your header for every (50?) lines or so to aid your readers. A way to do it below:

Instead of print $tb at the end of your script, the following would repeat the header every 50 lines.

my $rows = $tb->body_height(); $pagelines = 50; for my $i (0 .. $rows-1) { print $tb->title() if $i % $pagelines == 0; print $tb->body($i); print "\n" if $i % $pagelines == $pagelines-1; }

Chris

Update: set rows to the number of rows in table.
I was getting the number of items from keys %freq.


In reply to Re^4: Statistics via hash- NCBI BLAST Tab Delimited file by Cristoforo
in thread Statistics via hash- NCBI BLAST Tab Delimited file by Paragod28

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.