<?xml version="1.0" encoding="windows-1252"?>
<node id="1007882" title="Re: How can I run an folder full of text files through a perl script?" created="2012-12-08 05:16:01" updated="2012-12-08 05:16:01">
<type id="11">
note</type>
<author id="131741">
zentara</author>
<data>
<field name="doctext">
Here is a simple File::Find script that might help.
&lt;c&gt;
#!/usr/bin/perl
use File::Find;

$|++;

my $path = '.';

my $cmd = 'file'; # a test command

finddepth (\&amp;wanted,$path);

sub wanted {
  return unless (-f and -T); # only process text files
  
  system($cmd ,$_) or warn "$!\n";
  # or put your processing code here instead of system

 }

__END__
&lt;/c&gt;

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-131741"&gt;
&lt;hr /&gt;
I'm not really a human, but I play one on earth.&lt;br&gt;
[id://630805] ................... &lt;a href=http://zentara.net/japh.html&gt; flash japh &lt;/a&gt;

&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
1007878</field>
<field name="parent_node">
1007878</field>
</data>
</node>
