Hi,

I am trying to create this data structure as below:

$perl = [
    {
                fname           => 'Fred',
                lname           => 'Flintstone',
                residence       => 'Bedrock'
    },
    {
                fname           => 'Barney',
                lname           => 'Rubble',
                residence       => 'Bedrock'
    }
  ];


I have a couple of questions. a) What is it called. Is it an array of
hashes that is being stored in a scalar?
b) How can I create it from the data I have. Currently I have created a
single record, (see below), but I am having trouble understanding how I
can turn my $record below into a data structure like the one in the above
example.
I have managed to create a single record like this:

while(@row = fetchrow_array0
{
$record = {
TRADE_DATE      => $row[0],
TRADE_TIME      => $row[1],,
FIRSTNAME       => $row[2],
LASTNAME        => $row[3],
EXCHANGE        => $row[4],
SYMBOL          => $row[5],
};
}


Any help would be appreciated.
Thanks.

-rs

-- 
It's all a matter of perspective. You can choose your view by choosing
where to stand.
Larry Wall
---

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to