
funzie
Deleted
Oct 5, 2000, 4:06 PM
Post #1 of 1
(208 views)
|
|
I Need a line deleting code.
|
Can't Post
|
|
I just need a couple of lines of code that will find a line and delete it from the file. The one I have just deletes all the lines in the file. This is an example of one line: -iz-p-de--iz-br-de--iz-strong-de-Name-iz-/strong-de- - -iz-a href="mailto:1"-de-1-iz-/a-de--iz-br-de--iz-strong-de-Website-iz-/strong-de- - -iz-a href="1"-de-1-iz-/a-de--iz-br-de--iz-strong-de-ICQ#-iz-/strong-de- - 1-iz-br-de--iz-strong-de-Do You Like YourCGI.com?-iz-/strong-de- - 1-iz-br-de--iz-strong-de-Comments:-iz-/strong-de--iz-br-de-1-iz-/p-de- Here is the code I use: if ($FORM{'delete'}) { $line = "$FORM{'delete'}"; open(LIST,"$main_db"); @addresses=<LIST>; close(LIST); @add = grep{ !(/$line/i) } @addresses; open(LISTA,">$main_db"); print LISTA @add; close(LISTA); } Please, I really need help here. If you have suggestions or know how to fix it. Please post it. ------------------ Free remotly hosted CGI script to improve your website at http://www.yourcgi.com
|