develooper Front page | perl.beginners | Postings from March 2002

If (/start/ .. /end/) Flip Flop Mechanism

Thread Next
Steven M. Klass
March 2, 2002 10:11
If (/start/ .. /end/) Flip Flop Mechanism
Message ID:
Hi all

	I know there is a flip flop option but I'm not sure thats what I need..  
Here is what I want to do - and I have no idea how to do this.

Basically I have a section of text that I am doing a search and replace 
operation.  The problem is what if the search text doesn't exist - I still 
want to add it.

So the logic is if it exists in the region replace it, if you can't find it 
add to to it

if (/start/ .. /end/){

now what if foo didn't exist - bar still should be set!

Any ideas?


 Steven M. Klass
 Physical Design Manager

 National Semiconductor Corp
 7400 W. Detroit Street
 Suite 170
 Chandler AZ 85226


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About