<?xml version="1.0" encoding="windows-1252"?>
<node id="1012469" title="Re: Open a directory and recursively process files" created="2013-01-09 07:38:49" updated="2013-01-09 07:38:49">
<type id="11">
note</type>
<author id="171588">
BrowserUk</author>
<data>
<field name="doctext">
&lt;blockquote&gt;&lt;i&gt;&lt;/i&gt;&lt;/blockquote&gt;
&lt;p&gt;Neither, it is &lt;c&gt;my $line = @_;&lt;/c&gt; that is the problem. An array assigned to a scalar gives the number of elements in the array.

&lt;p&gt;What you should do is either the assignment you weren't sure about (but aren't actually using):&lt;c&gt;my $line = $_[0];&lt;/c&gt;
&lt;p&gt;Or, a list assignment: &lt;c&gt;my( $line ) = @_;&lt;/c&gt;
&lt;p&gt;Or, use [shift]:&lt;c&gt;my $line = shift;&lt;/c&gt;


&lt;p&gt;You should also drop the &amp; from your subroutine calls. Ie. &lt;c&gt;&amp;process_file ($file);&lt;/c&gt; should be &lt;c&gt;process_file( $file );&lt;/c&gt;

&lt;div class="pmsig"&gt;&lt;div class="pmsig-171588"&gt;
&lt;hr /&gt;
&lt;font size=1 &gt;
&lt;div&gt;With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'&lt;/div&gt;
&lt;div&gt;Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.&lt;/div&gt;
&lt;div&gt;"Science is about questioning the status quo. Questioning authority". &lt;/div&gt;
&lt;div&gt;In the absence of evidence, opinion is indistinguishable from prejudice.
&lt;/div&gt;
&lt;/font&gt;

&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1012467</field>
<field name="parent_node">
1012467</field>
</data>
</node>
