<?xml version="1.0" encoding="windows-1252"?>
<node id="1015044" title="Re^4: command line perl reading from STDIN" created="2013-01-23 18:32:54" updated="2013-01-23 18:32:54">
<type id="11">
note</type>
<author id="961">
Anonymous Monk</author>
<data>
<field name="doctext">
&lt;code&gt; perl -ne ' $s=&lt;&gt;; &lt;&gt;; &lt;&gt;; do_something_with_$s' &lt;/code&gt;
&lt;p&gt;is equivalent to
&lt;p&gt;&lt;code&gt; perl  -e ' while (&lt;&gt;) { $s=&lt;&gt;; &lt;&gt;; &lt;&gt;; do_something_with_$s} ' &lt;/code&gt; 

&lt;p&gt;so 4 lines will be read each pass, but only the second line will be used for anything

&lt;p&gt;Personally, I'd go with something like
&lt;p&gt;&lt;code&gt; perl -ne 'chomp; print length($_)."\n" if (/^@/);' &lt;/code&gt;
&lt;p&gt;instead.</field>
<field name="root_node">
1014740</field>
<field name="parent_node">
1014749</field>
<field name="reputation">
0</field>
</data>
</node>
