Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Hi,
I think really, you can achieve what you wanted, by combining all your have except that I would not favour C type of "for loop".. See a headup below:

use warnings; use strict; use Data::Dumper; <DATA>; #remove the heading if not needed my @data; my $counter; while(<DATA>){ chomp; $counter = 0; for (split/\s+/,$_){ push @{$data[$counter++]},$_; } } print Dumper \@data; __DATA__ METHOD 0TM 1TM 2TM >2TM method1 3 68 18 10 method2 3 80 10 6 method3 3 87 9 1 method4 5 83 9 3 method5 6 75 15 4 method6 14 77 6 3 method7 12 82 2 3 method8 9 84 3 3 method9 13 68 16 3 method10 5 65 20 9 method11 9 64 20 7 method12 5 68 18 9 method13 6 82 9 2 method14 11 79 8 2 method15 6 69 20 5 method16 5 80 11 3 method17 1 68 17 14
You get an ARRAY of ARRAY, then you can print out want you want.
for more info. Please check perldsc.
Update:
The code above produces ...
$VAR1 = [ [ 'method1', 'method2', 'method3', 'method4', 'method5', 'method6', 'method7', 'method8', 'method9', 'method10', 'method11', 'method12', 'method13', 'method14', 'method15', 'method16', 'method17' ], [ '3', '3', '3', '5', '6', '14', '12', '9', '13', '5', '9', '5', '6', '11', '6', '5', '1' ], [ '68', '80', '87', '83', '75', '77', '82', '84', '68', '65', '64', '68', '82', '79', '69', '80', '68' ], [ '18', '10', '9', '9', '15', '6', '2', '3', '16', '20', '20', '18', '9', '8', '20', '11', '17' ], [ '10', '6', '1', '3', '4', '3', '3', '3', '3', '9', '7', '9', '2', '2', '5', '3', '14' ] ];

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me

In reply to Re: Is this the correct structure? by 2teez
in thread Is this the correct structure? by Anonymous Monk

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!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others examining the Monastery: (16)
    As of 2014-10-23 16:41 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      For retirement, I am banking on:










      Results (126 votes), past polls