Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Search and replace query

by cdarke (Prior)
on Aug 26, 2011 at 10:23 UTC ( [id://922564]=note: print w/replies, xml ) Need Help??


in reply to Search and replace query

Is the condition the number of occurences "the third time this text appears" or when "it appears after a line, lets say, <bindname>abcde<\/bindname>"?

Which condition you require will determine the type if if statement you require.

Replies are listed 'Best First'.
Re^2: Search and replace query
by pvaldes (Chaplain) on Aug 26, 2011 at 11:18 UTC
    foreach my $line ( @fileArr ) { next if $line =~ m/<bindname>abcde<\/bindname><bindpass>welcom +e<\/bindpass> $line =~ s/<bindpass>welcome<\/bindpass>/<bindpass>Welcome1<\/ +bindpass/ }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2024-04-24 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found