in reply to Re: Question on anon hashes
in thread Question on anon hashes

Thanks for that!

The multi-level hash idea just came to me before I read your post. I don't know why I didn't think of it this afternoon while I was coding this.

As far as the regex goes, the data is on 2 seperate lines, so I don't think that combining the regex is necessarily the way to go. The multi-level hash idea seems the easiest for this program, keying on the school like you did.

Thanks again!

Some people fall from grace. I prefer a running start...

Replies are listed 'Best First'.
Re: Re: Re: Question on anon hashes
by graff (Chancellor) on Aug 21, 2002 at 05:16 UTC
    As far as the regex goes, the data is on 2 seperate lines, so I don't think that combining the regex is necessarily the way to go

    Hmmm. Well, your original code seemed to assume that those two separate lines were somehow stored in a single scalar sting, as in: "$data = get($line)" -- because after $data gets its value from this sub call, you split it with /\r?\n/. (you originally used /\r\n|\n/, which does the same thing.)

    So that's why I suggested ditching the split, and just looking for the combination of your two regexes separated by the line separator that was apparently embedded in $data.