in reply to Code explanation needed (was: What does this mean)
See the space, thats what it does when it does, I want that gone.--------- 1|cool.gif|aaa|yes|yes 3|biggrin.gif|:D|biggie|yes 5|tongue.gif|:p|tongue|yes ---------
sub set_del_yes { $storeline = $q->param('id'); open(FILE, "info/smileset.txt"); @file = <FILE>; close(FILE); chomp @file; my @matches = grep { $file[$_] =~ /^\Q$storeline|\E/ } 0..$#file; no_match($storeline), return unless @matches; duped_ids($storeline), return if @matches > 1; undef($file[$matches[0]]); delete($file[$matches[0]]); print "Smiley set has been deleted!<br><br> <a href=\"admin.cgi?pass=$pas&do=settings_set\">Smiley Set</a>"; open FLE, '>', 'info/smileset.txt' or die $!; print FLE $_, $/ for @file; close FLE or die $!; }
Edit kudra, 2002-06-10 Fixed literal [ and friend
Title edit by tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Deleting lines from an array
by Ovid (Cardinal) on Jun 10, 2002 at 14:39 UTC | |
|
Re: Deleting lines from an array
by Abigail-II (Bishop) on Jun 10, 2002 at 14:59 UTC |