in reply to Re: Re: Search & Replace in subdirectory files
in thread Search & Replace in subdirectory files
Also noticed your reg expression may not be what you want - may be better statedsub wanted { if (-f) { tie my @array, 'Tie::File', $_ or die $!; s/\$Log/\$History/gi for @array; untie @array; } }
That is $Log only appears as the first item in the line of text and always uses the same letter capitalization. So, you wouldn't need the g modifier because the word only appears once (at the beginning) and you wouldn't want the i option because the case doesn't (?) change. I put in the \b because in $Log, there shuldn't be any following word characters (judging from the sample you posted).s/^\$Log\b/\$History/
Chris
|
|---|