Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$files = "/perl/bin/ThisDirectoryHere"; opendir(DIR,$files) || die "Can not open directory: $!"; @files = grep(!/^\.+$/, readdir(DIR)); close(DIR); $ct = 0; #I need to open each file and change oldword to newword for(@files) { s/oldword/newword/gi; } print "\nTotal Changes = $ct\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Changing data in one directory
by tcf22 (Priest) on Jul 31, 2003 at 13:54 UTC | |
|
Re: Changing data in one directory
by l2kashe (Deacon) on Jul 31, 2003 at 14:16 UTC | |
|
Re: Changing data in one directory
by Zaxo (Archbishop) on Jul 31, 2003 at 14:12 UTC | |
|
Re: Changing data in one directory
by Cine (Friar) on Jul 31, 2003 at 14:12 UTC |