in reply to changing name within a file
Well, as for the search-and-replace, this should do it:
while ( <DATA> ) { s{^:dir=.*?([^/]*)$}{:dir=../mainDir/sudir/$1} ; print ; }
Also, since it sounds like your trying to replace all instances within a file, you might be able to save yourself a little bit of work with Tie::File.
Those who know that they are profound strive for clarity. Those who
would like to seem profound to the crowd strive for obscurity.
--Friedrich Nietzsche
|
|---|