mndoci has asked for the wisdom of the Perl Monks concerning the following question:

Hi folks I want to try and do the following. I want go through an array, @seqlist, and for each element $seq, I want to open a file $statfile which has data something like this
============================================ $seqlist[0] somenumber ============================================ sorted tables mixed with some lines of text . (these data associated with $seqlist[0] . . ============================================ $seqlist[1] someothernumber ============================================ . . . .. and so on
What I want to do is grab  $seqlist[0] and sort the data columns associated with $seqlist[0]. These columns have some lines of text interspersed, which I want to get rid of. I think I can handle that using a regex that only searches for lines which have numbers, text and whitespace. I can then sort the data on the basis of of the numbers in one of the columns. What I am not sure about is how to limit this to the data associated with each element of the array?
Thanks
mndoci

"What you do in this world is a matter of no consequence. The question is, what can you make people believe that you have done?"-Sherlock Holmes in 'A study in scarlet'

Replies are listed 'Best First'.
Re (tilly) 1: Regex help: I hope I make sense
by tilly (Archbishop) on Nov 10, 2001 at 07:52 UTC
    While what you are looking for can be done, when you finish what you will be doing is reinventing the relational database. Rather than continue down this path I would suggest installing MySQL and learning how to use it instead. It will take less time to learn, and when you are done you will have a more robust and flexible solution, which scales better.

    Depending on your needs you might like to start instead with the DBD::CSV driver for DBI. That way you don't have to install a database first (though I strongly recommend doing so for the performance, scalability, ability to handle concurrent connections, etc).

      How I would love to be able to do that ( I do know how to use mySQL), but that is out of my hands. For now I am stuck with flat files. From what I can gather, you think it is a dumb idea to go about what I want to do (I wholeheartedly agree), but as I mentioned I am a little limited for other reasons.

      "What you do in this world is a matter of no consequence. The question is, what can you make people believe that you have done?"-Sherlock Holmes in 'A study in scarlet'