in reply to string manipulation

I am not trying to be rude and picky, but to be frank, I had to look at the screen really closely to see, where each of the three elements started. I understand that part of the problem is that you have to posted it within this small space. How do you actually store those data in your production code? Did you have a easy to understand, easy to maintain, and visually nice way? Monks, any suggestion? How to write this with some beauty?

Replies are listed 'Best First'.
Re: Re: string manipulation
by Anonymous Monk on Jun 20, 2003 at 20:42 UTC
    It looks like he's got more than one piece of information per string. Much better to split that out into a hash and have an array of hashes. It's even cooler cause it's now self-documenting. :-)
Re: Re: string manipulation
by BrowserUk (Patriarch) on Jun 20, 2003 at 22:12 UTC

    I thought the same thing, but then concluded that the data is probably read in from a file rather than hardcoded into a program and was only posted that way for the purposes of asking the question.

    If I really had to embed such long lines of text into a script, I'd probably use something like

    @array = ( '>143B_HUMAN (P31946) 14-3-3 protein beta/alpha ' . '(Protein kinase C inhibitor protein-1) (KCIP-1) (Protein 1054) ' . 'TMDKSELVQKAKLAEQAERYDDMAAAMKAVTEQGHELSNEERNLLSVAYKNVVGARRSSWR' . 'VISSIEQKTERNEKKQQMGKEYREKIEAELQDICNDVLELLDKYLIPNATQPESKVFYLKM' . 'KGDYFRYLSEVASGDNKQTTVSNSQQAYQEAFEISKKEMQPTHPIRLGLALNFSVFYYEIL' . 'NSPEKACSLAKTAFDEAIAELDTLNEESYKDSTLIMQLLRDNLTLWTSENQGDEGDAGEGEN', # ... );

    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller