Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: changing name within a file

by greenFox (Vicar)
on Aug 30, 2002 at 00:38 UTC ( #193958=note: print w/replies, xml ) Need Help??


in reply to changing name within a file

If I understood correctly-

perl -pi.bak -e 's# :dir=\.\./(somthing.cpp)# :dir=\.\./mainDir/sudir/$1#' file

If you want to do this as part of a larger script take a look at Tie::File or Editing Files In Place

Update:added :dir=

Update:eeek! I just noticed that this node is awfully like this one have I failed dws's homework appeal?

--
Until you've lost your reputation, you never realize what a burden it was or what freedom really is. -Margaret Mitchell

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://193958]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (1)
As of 2022-01-17 07:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (51 votes). Check out past polls.

    Notices?