Hello,
I have several files in a directory, and I need to create a config file
for each one of them. I already have a standard config file, but it must be
modified for each of the files in the directory (hope this makes sense).
Here is what I have:
#!/usr/bin/perl -w
use File::Copy;
opendir MYDIR, "." or die "egad!: $!";
@allfiles = grep !/^\.\.?$/, readdir MYDIR;
closedir MYDIR;
foreach $allfiles (@allfiles) {
copy("config", "config.$allfiles");
eval "s//mydirectorystucture/log//mydirectorystucture/log/$allfiles/g"
}
This creates the config files I need, but does not do the replacement.
Thanks in advance for any help.