CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
I Need a line deleting code.

 



funzie
Deleted

Oct 5, 2000, 4:06 PM

Post #1 of 1 (348 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

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives