<?xml version="1.0" encoding="windows-1252"?>
<node id="1004916" title="Re: Regular expression help" created="2012-11-21 08:21:09" updated="2012-11-21 08:21:09">
<type id="11">
note</type>
<author id="533863">
roboticus</author>
<data>
<field name="doctext">
&lt;p&gt;[ananassa]:&lt;/p&gt;
&lt;p&gt;Your code is assuming that you're getting seven columns from your split on line 22.  Then you're using several of those to do a regex match.  However the last line of your file, for example, is likely empty (because many files end in a '\n'), causing you to have fewer than 2 columns fields array.&lt;/p&gt;
&lt;p&gt;You might try something like:&lt;/p&gt;
&lt;c&gt;
...
my @fields = split /\t/, $item;
next if @fields &lt; 7;
...
&lt;/c&gt;

&lt;p&gt;...[roboticus]&lt;/p&gt;
&lt;p&gt;&lt;i&gt;When your only tool is a hammer, all problems look like your thumb.&lt;/i&gt;&lt;/p&gt;</field>
<field name="root_node">
1004901</field>
<field name="parent_node">
1004901</field>
</data>
</node>
