Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: how to format print statements with data from array

by jethro (Monsignor)
on Mar 24, 2009 at 20:06 UTC ( [id://752958]=note: print w/replies, xml ) Need Help??


in reply to how to format print statements with data from array

Your question was a bit short on the underlying data it operates on. But if I read your code right, all you need to do is exchange your loops. I.e. the outer loop with the names/aligndata stuff should be inner loop and the loop over @$scoreData should be outer loop.

The problem is that you read from a file ($fhnames) in the aligndata loop. If it gets to be inner loop it shouldn't do that anymore. Hopefully the data in the file is not to big to be read into memory, otherwise you might have to compact it or store it into a database. But since you want to print it in one line it seems that should not be a problem.

After you have exchanged the loops all you need to do is collect the single chars instead of printing them directly and print the summary directly after the end of the inner loop

  • Comment on Re: how to format print statements with data from array

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://752958]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 18:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found