<?xml version="1.0" encoding="windows-1252"?>
<node id="448601" title="Re^4: cut vs split (suggestions)" created="2005-04-17 03:01:16" updated="2005-05-21 02:58:51">
<type id="11">
note</type>
<author id="387687">
sk</author>
<data>
<field name="doctext">
Very interesting! Thanks for the new idea!&lt;p&gt;
I lost my server connection for some reason and so I tested this on my laptop and I do see a very good improvement with the your modification.&lt;p&gt;
&lt;b&gt; update: corrected &lt;&gt; with $_ per pijll post&lt;/b&gt;
&lt;code&gt;
C:\&gt;perl -lne "BEGIN{$,=','} print+(split',',$_)[0..14] " &gt; junk
&lt;/code&gt;

this finishes in about 14 seconds....&lt;b&gt; corrected timing&lt;/b&gt;&lt;p&gt; 

&lt;code&gt;
C:\&gt;perl -lanF, -e "BEGIN{ $,=\",\"} print @F[0..14];" numbers.csv &gt; junk
&lt;/code&gt;

this takes about 18 seconds&lt;p&gt;

I don't have a timing utility in Windows so the times are just wallclock times.&lt;p&gt;

I guess windows is faster because the process run at 100% CPU (or whatever is required i guess?). On the UNIX servers the process might be more time-shared?&lt;p&gt;

My laptop is 1.6G Centrino/1GB Ram/perl, v5.6.1&lt;p&gt;

cheers&lt;p&gt;
SK

&lt;b&gt;Update:&lt;/b&gt; Thanks pijll, the time it takes to run your version of the code is almost same as the one that uses -n.</field>
<field name="root_node">
448559</field>
<field name="parent_node">
448598</field>
</data>
</node>
