<?xml version="1.0" encoding="windows-1252"?>
<node id="588381" title="Re^3: parsing question" created="2006-12-07 11:20:16" updated="2006-12-07 06:20:16">
<type id="11">
note</type>
<author id="61400">
joeface</author>
<data>
<field name="doctext">
&lt;p&gt;
This sets the default line-separator (held in "$/", normally set to "\n") to undef, so that whatever comes in from STDIN (&lt;&gt;) will get slurped up, split on the string "-{103}", and assigned to @sections.
&lt;/p&gt;

&lt;p&gt;
A short example... put the following into a script named "test.pl":
&lt;/p&gt;

&lt;code&gt;
#!/usr/bin/perl -w

use strict;

my @sections = split 'FOO', do {local $/; &lt;&gt;};
close *ARGV;

print join("\n", @sections);
&lt;/code&gt;


&lt;p&gt;
Then, put the following into a file called "test.txt":
&lt;/p&gt;

&lt;code&gt;
FOObarFOObarFOObarFOObarFOObar
FOObarFOObarFOObarFOObarFOObar
FOObarFOObarFOObarFOObarFOObar
&lt;/code&gt;

&lt;p&gt;
Then, run the following at the command-line:
&lt;/p&gt;

&lt;code&gt;
cat test.txt | ./test.pl
&lt;/code&gt;</field>
<field name="root_node">
588246</field>
<field name="parent_node">
588314</field>
</data>
</node>
