I have a small array that looks like this:

@array = qw(rtf1_deff fonttbl s33_up7)

I generate this file from parsing an rtf file. I have to process each
element in the array. I have to separte the letters from the numbers. So
the first element would break down to "rtf" and "1". Based on the first
part of the element (the "rtf" part), I have to determine a set of
actions. 

Later on in the program, I need to once again process each element in
the array, and that means separtaing the letters from the numbers. It
seems ineffecient to do this twice.

Should I create a hash within my array? In other words, each element
in the array will have one or more values attatched to it:

rtf1_deff: ignore, 1 (ignore this, it's number is one);
font_table: ignore
s33_up7: print, 33

I'm not sure how to create this data structure. The *Cookbook* shows you
how to created hashes within hashses, but not hashes within arrays. (Or
do I want to create an array within an array?)

My second question is whether I should bother. I would rather just
process the elements twice by sending them to a subroutine, but I don't
want to unnecessarily slow down my script.

Thanks!

Paul

-- 

************************
*Paul Tremblay         *
*[EMAIL PROTECTED]*
************************

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to