<?xml version="1.0" encoding="windows-1252"?>
<node id="1018937" title="Re^2: Printing Last Element of a line using perl memory?" created="2013-02-15 13:12:03" updated="2013-02-15 13:12:03">
<type id="11">
note</type>
<author id="718055">
jaredor</author>
<data>
<field name="doctext">
&lt;p&gt;++ for the END block idea. A further tweak would be to not process data in the main loop, but only the END block. Unfortunately I could not think of a slick way to make $_ available to END from the last loop iteration, so I had to cheat a little to golf your solution. Apparently the autosplit array does remain resident:&lt;/p&gt;
&lt;code&gt;perl -nae 'END { print "$F[-1]\n"; }' scan.log&lt;/code&gt;
&lt;p&gt;Good examples like yours are weaning me from sed ;-)&lt;/p&gt;</field>
<field name="root_node">
1018813</field>
<field name="parent_node">
1018828</field>
</data>
</node>
