Re: multidimensional insertion order
- From: Spin <cNaOlSePbA@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Jul 2005 14:37:19 -0600
Paul Lalli wrote:
You're attempting to tie a reference to a hash to the Tie::IxHash class. A reference is a scalar. Therefore, tie() is attempting to use a non-existant TIESCALAR method.
You *want* to tie the hash that that reference references to the Tie::IxHash class.
Try: (untested)
tie %{$xml_lines{$section}->{$section_number}}, "Tie::IxHash";
That truncates the hash somehow.
Using Data::Dumper this is the output from what you suggested above:
%xml_lines = (
'Header' => {
'1' => {
'DOB' => '05/05/02'
}
},
'Gross Necropsy' => {
'1' => {
'Clinician' => 'Joe Nobody, DVM',
'Report' => 'blah blah blah',
'Report_unparsed' => 'blah blah blah'
}
},
'Histopathology' => {
'1' => {
'Clinician' => 'Joe Nobody, DVM',
'Report' => 'blah blah blah',
'Report_unparsed' => 'blah blah blah'
}
OTOH if I comment the aggravating line out, Data Dumper shows:
%xml_lines = (
'Header' => {
'1' => {
'Sex' => 'Spayed Female',
'Date' => '07/28/05',
'Owner' => 'Joe Somebody',
'Breed' => 'Hedgehog',
'Species' => 'Insectivora',
'DOB' => '05/05/02',
'Patient' => 'Spikey*'
}
},
'Gross Necropsy' => {
'1' => {
'Sex' => 'Spayed Female',
'Template' => 'necropsy',
'Date' => '06/30/05',
'Clinician' => 'Joe Nobody, DVM',
'Owner' => 'Joe Somebody',
'Breed' => 'Hedgehog',
'Report_unparsed' => 'blah blah blah',
'Species' => 'Insectivora',
'DOB' => '05/05/02',
'Report' => 'blah blah blah',
'Patient' => 'Spikey*'
}
},
'Histopathology' => {
'1' => {
'Sex' => 'Spayed Female',
'Template' => 'necropsy',
'Date' => '07/11/05',
'Clinician' => 'Joe Nobody, DVM',
'Owner' => 'Joe Somebody',
'Breed' => 'Hedgehog',
'Report_unparsed' => 'blah blah blah',
'Species' => 'Insectivora',
'DOB' => '05/05/02',
'Report' => 'blah blah blah',
'Patient' => 'Spikey*'
}
}
);
I changed the output to maintain patient confidentiality; hopefully I didn't add any typos.
The $section_number is used for occasions when we have >1 report by the same name. For example, two surgery reports if the patient required two surgeries while hospitalized. You would understand how essential it is to have it kept in order at the Section_Number level.
TIA Caleb .
- Follow-Ups:
- Re: multidimensional insertion order
- From: xhoster
- Re: multidimensional insertion order
- References:
- multidimensional insertion order
- From: Spin
- Re: multidimensional insertion order
- From: Abigail
- Re: multidimensional insertion order
- From: Spin
- Re: multidimensional insertion order
- From: Paul Lalli
- Re: multidimensional insertion order
- From: Spin
- Re: multidimensional insertion order
- From: Paul Lalli
- Re: multidimensional insertion order
- From: Spin
- Re: multidimensional insertion order
- From: Paul Lalli
- multidimensional insertion order
- Prev by Date: Re: length of an array in a struct in an array of structs in a struct in an array of structs
- Next by Date: Re: multidimensional insertion order
- Previous by thread: Re: multidimensional insertion order
- Next by thread: Re: multidimensional insertion order
- Index(es):
Relevant Pages
|