The code I have is part of a larger system with lots of arrays and lots of data, and I'm afraid I have no way of getting it off and showing it. The code that I was using was the same as my first reply to you only with the variable names changed to protect the innocent. The results were also the same as in my reply with the data values also changed.

I was interested in preserving the contents of the array, so I was trying not to destroy the data in it. That is why I was trying such unholy constructs. Looking at the answers that I received, I think that I will go with the ideas suggested by haukex and poj where I change the string value in the array into some hashes. It will require a little refactoring of places that access @excerpts (not its real name). To get the string contents, it will have to access $excerpts[$i]{content} instead of $excerpts[$i]. But it will now be possible to access $excerpts[$i]{fpart} and $excerpts[$i]{bpart} as well.


In reply to Re^10: Adding hashes to already existing array by ExReg
in thread Adding hashes to already existing array by ExReg

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.