substitution

How do I substitute with an evaluated expression in Perl?

There's a file dummy.txt The contents are: 9/0/2010 9/2/2010 10/11/2010 I have to change the month portion (0,2,11) to +1, ie, (1,3,12) I wrote the substitution regex as follows $line =~ s/\/(\d+)\//\/\1+1\//; It's is printing 9/0+1/2010 9/2+1/2010 10/11+1/2010 How to make it add - 3 numerically than perform string concat?...

vim replace character to \n

I need replace all ; to \n , but :%s/;/\n/gc not works ...

perl substitute multiple lines

Hi all, I have a file which looks like: <QUERY name="Secondary"> <SQLStmt>select * from my_tb; </SQLStmt> <QUERY name="primary"> <SQLStmt>select * from my_tb; </SQLStmt> <QUERY name="last"> <SQLStmt>select * from my_tb; </SQLStmt> I need to substitute the SQLStmn...