Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Sorting measurementsby anonymized user 468275 (Curate) |
on Aug 19, 2015 at 09:27 UTC ( [id://1139155]=note: print w/replies, xml ) | Need Help?? |
Hi Jenny,
To terminate a line of output and start the next line, you print "\n". In this case you only want to do that when the tries are exhausted and otherwise a tab or space separator. e.g.:
I put "Oops" instead of the measurement value because I am presuming there are different values per try, otherwise more than one try would be redundant, but you have only one value per measurement type. Perhaps you need an array of array for the values as another poster has suggested. If so, you'll also need to index through them per inner loop. The last print statement I put in may seem harder to read -- it's a shorthand for the following logic: "decrement $toTry, then print tab if there are still tries left else print cr" - You'll probably have to change that anyway when you re-organise the values array. One world, one people
In Section
Seekers of Perl Wisdom
|
|