Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: How can I run an folder full of text files through a perl script?

by zentara (Archbishop)
on Dec 08, 2012 at 10:16 UTC ( #1007882=note: print w/ replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007882]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2014-11-23 10:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (130 votes), past polls