Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 examining the Monastery: (15)
As of 2015-07-01 17:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (12 votes), past polls