<?xml version="1.0" encoding="windows-1252"?>
<node id="1008524" title="Re: process a file and reading a line and passing the values to another sub function" created="2012-12-12 11:28:12" updated="2012-12-12 11:28:12">
<type id="11">
note</type>
<author id="708738">
LanX</author>
<data>
<field name="doctext">
please try to condense code to the relevant parts or mark them better.&lt;P&gt;

I really started counting the lines till 35 before I saw your comment.&lt;P&gt;

 something like:
&lt;c&gt; $line = &lt;FILE&gt;;                 #  &lt;---------- 35
    # this line doesn't work. don't know what's wrong here..
&lt;/c&gt;&lt;P&gt;

is easier to find.&lt;P&gt;

anyway, you did it twice:&lt;P&gt;

&lt;c&gt;
  @buf = &lt;FILE&gt;;                     # you reading all lines of FILE into @buf
  foreach $line (@buf) {             # OK! (well, "my $line" would be better)
     $line = &lt;FILE&gt;;                 # but now reading again a single line !?! 
                                     #     which is  undef after EOF
&lt;/c&gt;&lt;P&gt;

please less cargo cult programming!&lt;P&gt;

Don't c&amp;p different approaches from other snippets, better try to understand what's happening.&lt;P&gt;

 &lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-708738"&gt;
&lt;p&gt;Cheers Rolf
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1008518</field>
<field name="parent_node">
1008518</field>
</data>
</node>
