<?xml version="1.0" encoding="windows-1252"?>
<node id="1017880" title="perl onliner on multiple files" created="2013-02-08 14:33:56" updated="2013-02-08 14:33:56">
<type id="115">
perlquestion</type>
<author id="782956">
abhay180</author>
<data>
<field name="doctext">
I want to execute following perl-one-liner on a set of files (tmp_*) in a directory....

&lt;code&gt;
% perl -e ' while (&lt;&gt;) { if (/: /) {  $c += (split /: /)[0]; }  } print "SUM.$ARGV =$c\n"' tmp_*

&lt;/code&gt;
or
&lt;code&gt;
%perl -e ' while (&lt;&gt;) { if (/: /) {  $c += (split /: /)[0]; }  } print "SUM.$ARGV =$c\n"' | xargs cat tmp_filelist
&lt;/code&gt;

so on.....

Nothing seems to work...it just does for one file and exits....

Help

</field>
</data>
</node>
