moked has asked for the wisdom of the Perl Monks concerning the following question:
However, it's printing out the substitutions but it's not printing to the file.#!/usr/bin/perl @folder = <*>; foreach $folder (@folder) { if (-d $folder) {opendir (DH, "$folder") or warn "can't open directo +ry $folder for read\n"; foreach $file (readdir DH) { if(!(-d $file)){print"$folder/$file\n";open(READ,"+<$folder/$file" +) or die "can't open"; while (<READ>){((s/Manual_common_macros/test_macros/ge)||(s/Manu +al_constants/test_constants/ge))&&(print READ $_)&&(print)&&($|=1);} } close(READ); } } closedir(DH); } exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Edit a text file line by line
by poolpi (Hermit) on Apr 06, 2008 at 09:32 UTC | |
|
Re: Edit a text file line by line
by Erez (Priest) on Apr 06, 2008 at 08:40 UTC | |
|
Re: Edit a text file line by line
by jwkrahn (Abbot) on Apr 06, 2008 at 18:29 UTC |