http://www.perlmonks.org?node_id=1007882


in reply to How can I run an folder full of text files through a perl script?

Here is a simple File::Find script that might help.
#!/usr/bin/perl use File::Find; $|++; my $path = '.'; my $cmd = 'file'; # a test command finddepth (\&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__

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
  • Comment on Re: How can I run an folder full of text files through a perl script?
  • Download Code