<?xml version="1.0" encoding="windows-1252"?>
<node id="567159" title="Re: Converting a Flat-File to a Hash" created="2006-08-14 02:18:11" updated="2006-08-13 22:18:11">
<type id="11">
note</type>
<author id="489086">
mickeyn</author>
<data>
<field name="doctext">
no Tie suggestions ?  :-)&lt;p&gt;

ok, here's one:&lt;br&gt;

&lt;code&gt;
#!/usr/bin/perl
use strict; use warnings;
use Tie::File;
tie my @array, 'Tie::File', "/the/file/in/question" or die "can't tie file";
my %data = map { split /:/; $_[0] =&gt; $_[1] } @array;
&lt;/code&gt;

Enjoy,&lt;br&gt;
Mickey</field>
<field name="root_node">
567118</field>
<field name="parent_node">
567118</field>
</data>
</node>
