How do you store strings in a variable-sized array?
Background:
I wrote a program earlier today to work with a very large text file. I chose Perl because it lets me do some nice formatting on the text I grab, instead of just using a shell script to con'cat'enate egrep results.
The program worked pretty nicely, outputting html that is displayed in the browser. (This is useful, not just pretty: the generated web page has many links, and it's much more convenient to click than copy/paste/modify.) But I wanted to modify the results based on whether there is a match or not for each section. If there are 1 or more matches, write the header, the formatted matches, and the footer; otherwise write nothing.
I have a large @all array which will contain a few (maybe 0-100) matches for a particular regular expression. I'd like to store the matches -- actually, formatted text based on those matches -- in an array so I can work with them later. What's the best way to do this? I'd like to get better with perl rather than just emulate C in perl, so I thought it might be a good idea to post here rather than just butt my head against the language a bit longer.