Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Recursive file processing from a path and printing output in a file

by CountZero (Bishop)
on Dec 08, 2012 at 19:36 UTC ( #1007919=note: print w/replies, xml ) Need Help??

in reply to Recursive file processing from a path and printing output in a file

Examine File::Find::Rule and more specifically the start and match methods.

The logic of your program can then be simplified as follows:

use Modern::Perl; use File::Find::Rule; my $start_dir = 'c:/Test'; my $rule = File::Find::Rule->file->start($start_dir); while ( defined( my $file = $rule->match ) ) { # process $file ... }
Why do you need to replace the spaces in the files you found to comma's? I cannot see any good reason for that.

To transform your files into XML format, several XML modules exist, such as XML::Writer. Writing XML is not simple, there are many rules to follow and these modules take care of it.


A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

My blog: Imperial Deltronics

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007919]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2017-08-19 10:22 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (310 votes). Check out past polls.