Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: run a perl script for all files in a folder

by aaron_baugher (Curate)
on Aug 06, 2012 at 13:01 UTC ( #985698=note: print w/replies, xml ) Need Help??


in reply to run a perl script for all files in a folder

Wrapping one perl script in another perl script just to loop through files tends to look like overkill to me. Just use the shell:

$ for i in folder/* ; do perl addclause.pl <$i; done

Aaron B.
Available for small or large Perl jobs; see my home node.

Replies are listed 'Best First'.
Re^2: run a perl script for all files in a folder
by lakssreedhar (Acolyte) on Aug 08, 2012 at 05:45 UTC

    2 Aaron.I tried the shell but it produces an error like cannot open the file

      Thanks Aaron,your shell script worked

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://985698]
help
Chatterbox?
[Corion]: Hi all! After 13 years or so in the same room, I've now moved to a new room (one door further) - weird :-D
[moritz]: I had an office move too, two floors up
[moritz]: so far I've managed not to get into my old office by accident, but once it was close (already stopped at the wrong floor)

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (8)
As of 2017-10-17 08:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (224 votes). Check out past polls.

    Notices?