in reply to Suggestions on how to make array of hashes with this...

if the data is always in that order, I'd just go for broke:
$_ = join "", @SORTME, "\n\n"; while (/(AMAFILE):\s+(.*)\n(STATUS):\s+(.*)\n(DATE CREATED):\s+(.*)/g) + { push @array, { $1, $2, $3, $4, $5, $6 }; }
If you can't count on the order (although your example was entirely ordered), then it's a bit harder, but still pretty straightforward.

-- Randal L. Schwartz, Perl hacker

Replies are listed 'Best First'.
Re: Re: Suggestions on how to make array of hashes with this...
by snafu (Chaplain) on Sep 21, 2001 at 09:37 UTC
    Yes sir. The order will never change...er well, it shouldn't. I wrote the script that this pulls from though so I should be able to doc it pretty well.

    So, for your example then, let me make sure I got it straight what you are doing.

    You are joining each element in $_ to @SORTME (don't quite follow the purpose of the two carriage returns after your join though. Then you are taking $_ in your while loop and extracting AMAFILE, STATUS, and DATE CREATED and their values into $1..$6 and pushing them into the array @array, right? I noticed something different about this array though. Is this a multi-dim array?

    ----------
    - Jim