yitzle wrote:
Always start your code with:
use warnings;
use strict;

my %record = r();
This line won't work. r() returns a reference (think pointer if you
used C) to a hash. You need a scalar to store it.
$record = r();

Or dereference the reference returned from the sub:

my %record = %{ r() };


$record{fieldA}{fieldB} = value...
This requires a hash, unlike the above line that used a hash. You can
create a hash and assign its reference to a scalar like so:
$ref = \%hash;

Or copy the hash to an anonymous hash and assign that reference:

$ref = { %hash };


push @records, %record
I think you want an array of references, not of hashed themselves.

Actually, the hash is converted to a list and that list is pushed onto the array.


John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall

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


Reply via email to