A
Anonymous
As usually, my apologies for the newbie type question from an infrequent
user.
I have a directory tree (path is $tree0), and I would like to duplicate the
tree structure into two other tree roots ($tree1 and $tree2). I want to
process the files in the original tree with two different subroutines, call
them Process1 and Process2 so that the files in the duplicated trees are not
really exact copies but versions produces by Process1(individualFile) and
Process2(individualFile).
I can find my way down the original tree OK using File::Find, get the name
($File::Find::name) (.... this is progress for a novice, so don't laugh) and
do something with the file. But duplicating the structure has me completely
baffled.
#!/bin/perl
use File::Find;
my $tree0="c:\\k\\origtree";
# Find the original files
find(\&processAllFiles, $tree0);
# Subroutine that decends the tree.
sub processAllFiles{
print "$File::Find::name\n";
# HELP HELP
}
I would appreciate any help, whether general pointer to a place to read, an
appropriate old note in the archive, or code snippet.
Cheers,
user.
I have a directory tree (path is $tree0), and I would like to duplicate the
tree structure into two other tree roots ($tree1 and $tree2). I want to
process the files in the original tree with two different subroutines, call
them Process1 and Process2 so that the files in the duplicated trees are not
really exact copies but versions produces by Process1(individualFile) and
Process2(individualFile).
I can find my way down the original tree OK using File::Find, get the name
($File::Find::name) (.... this is progress for a novice, so don't laugh) and
do something with the file. But duplicating the structure has me completely
baffled.
#!/bin/perl
use File::Find;
my $tree0="c:\\k\\origtree";
# Find the original files
find(\&processAllFiles, $tree0);
# Subroutine that decends the tree.
sub processAllFiles{
print "$File::Find::name\n";
# HELP HELP
}
I would appreciate any help, whether general pointer to a place to read, an
appropriate old note in the archive, or code snippet.
Cheers,