Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

perl one liner to replace matching string

by vinoth.ree (Monsignor)
on Jun 10, 2018 at 07:24 UTC ( [id://1216291]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $ext='c';
    qx("perl -p -i -e \"s/(\@Filetyp\\s*?:)/\\1$ext/\" /path/test.c")
    
  2. or download this
    perl -p -i -e "s/(@Filetyp\s*?:)/\1c/" /path/test.c
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-20 01:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found