<?xml version="1.0" encoding="windows-1252"?>
<node id="1006699" title="Re: split a line by control ^D character" created="2012-12-02 05:55:13" updated="2012-12-02 05:55:13">
<type id="11">
note</type>
<author id="176576">
eyepopslikeamosquito</author>
<data>
<field name="doctext">
&lt;P&gt;
The problem is that the &lt;C&gt;chr(4)&lt;/C&gt; inside your &lt;C&gt;/chr(4)/&lt;/C&gt; regex is not being interpreted as a function call; rather it is being interpreted literally, with the parens in &lt;C&gt;chr(4)&lt;/C&gt; being interpreted as regex metacharacters to capture the 4 in a matching &lt;C&gt;chr4&lt;/C&gt;, for example!
&lt;/P&gt;

&lt;P&gt;
There are a number of ways to fix this, for example:
&lt;CODE&gt;
@LineDetails = split /\04/, $line;    # ... or
@LineDetails = split chr(4), $line;
&lt;/CODE&gt;
&lt;/P&gt;
</field>
<field name="root_node">
1006696</field>
<field name="parent_node">
1006696</field>
</data>
</node>
