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

Re^3: Dera Monks, Have create multiple file from one file now I want to match a pattern in each file at the same time do the replacement with adding one to the match pattern.

by hemantjsr (Initiate)
on Jan 02, 2015 at 12:40 UTC ( #1111992=note: print w/replies, xml ) Need Help??


in reply to Re^2: Dera Monks, Have create multiple file from one file now I want to match a pattern in each file at the same time do the replacement with adding one to the match pattern.
in thread Dera Monks, Have create multiple file from one file now I want to match a pattern in each file at the same time do the replacement with adding one to the match pattern.

Yes Dera your understanding is correct. Could you please help me tell how to do substitution incrementally. As I try to do with \K which seems not working for me, done the changes $n++

$lines[0] =~ s~/4947000219/\K(4947000210+)~$1+$n~e;
  • Comment on Re^3: Dera Monks, Have create multiple file from one file now I want to match a pattern in each file at the same time do the replacement with adding one to the match pattern.
  • Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2019-11-19 10:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (95 votes). Check out past polls.

    Notices?