Hey Perl-Pros!

As a Perl-Newbie, I'm currently dealing with a programming problem and would like to hear some tipps of someone more experienced in Perl-programming. I'm trying to sort some measurements which I loaded from some SQL-tables in Perl-lists. There are lists with the following structure:

@MeasurementType = (MeasurementA, MeasurementB, Measurement C, Measure +mentB, MeasurementB,..........); @MeasurementValue = ( 1A, 3A , 3A , 2A, 5A, ……); @MeasurementTry= (1 , 1 ,1 , 2 , 3, ….); @MeasurementTime= (DateA, DateB, DateC, DateD, DateE,.....); [ All lists have the same length, since they should be seen together, +as their single elements represent the different measurements e.g..Measurement[0]= @MeasurementType[0],@MeasurementValue[0],@Measur +ementTry[0],@MeasurementDate0] I'm trying to create a list, which creates an output like: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ [Measurement] --[1.Try (MeasurementDate, MeasurementValue]--[2. Try]-- +[3.Try] MeasurementA -- DateA, 1A -- ______-- _______ MeasurementB -- DateB, 3A -- DateD,2A -- DateE,5A MeasurementC -- DateC, 3A -- ______-- _______ +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Requirement: If there are more than one try for a measurement, the different tries should be listed next to each other in the same row.

Whats the best way to do this?
Since Perl doesn't support two-dimensional arrays, I would try to connect the seperate lists with an additional list where I save references to them. Doing so, I can use a "for each" to easily print out all measurements. Unfortunately, this will only list all measurements underneath each other. Measurements, which have been done more than one time (see MeasurementB in example) shouldn't be added as multiple rows, but as as 2nd or 3rd try in the same row from the first try. Anyone of you got an advice how to accomplish this?


In reply to Sorting measurements by Jenny1990

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.