<?xml version="1.0" encoding="windows-1252"?>
<node id="1001957" title="Re^3: Forcing array context on a file handle" created="2012-11-02 08:31:47" updated="2012-11-02 08:31:47">
<type id="11">
note</type>
<author id="294463">
QM</author>
<data>
<field name="doctext">
That works for files in the default case, because every line will have a newline or somesuch, and will not be an empty string. For counting, &lt;code&gt;map&lt;/code&gt; would be more appropriate than &lt;code&gt;grep&lt;/code&gt;. But [tobyink] showed the idiom [id://1001550|above]:
&lt;code&gt;
my $lines =()= &lt;$file&gt;;
&lt;/code&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-294463"&gt;
&lt;p&gt;-QM&lt;br /&gt;
--&lt;br /&gt;
Quantum Mechanics: The dreams stuff is made of
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1001549</field>
<field name="parent_node">
1001614</field>
</data>
</node>
