M
mohamad.ridha
Hi all,
I am trying to write a simple script but stuck with one problem on how
to assign a hash of array to another hash.
I have this hash named "record" that consists of two keys "recinfo" and
"recbody" and each key is assigned to hold an array of strings that
have been filled with values. The following code seems to work:
$record {"info"} = [ @recinfo ];
$record {"body"} = [ @recbody ];
But then I need to implement another hash named "recordlist" that has
variable "$recid" as keys, and each key will hold a "record" hash
above. I tried to use the following statement to assign the "record"
that has already filled with values to "recordlist" but to no avail.
$recordlist {"$recid"} = { %record };
Does anyone how to solve this problem?
Thanks in advance!
--Ridha
I am trying to write a simple script but stuck with one problem on how
to assign a hash of array to another hash.
I have this hash named "record" that consists of two keys "recinfo" and
"recbody" and each key is assigned to hold an array of strings that
have been filled with values. The following code seems to work:
$record {"info"} = [ @recinfo ];
$record {"body"} = [ @recbody ];
But then I need to implement another hash named "recordlist" that has
variable "$recid" as keys, and each key will hold a "record" hash
above. I tried to use the following statement to assign the "record"
that has already filled with values to "recordlist" but to no avail.
$recordlist {"$recid"} = { %record };
Does anyone how to solve this problem?
Thanks in advance!
--Ridha