Im trying to delete a $array[value] out of @array, but wehn I print to my text file it like
---------
1|cool.gif|aaa|yes|yes
3|biggrin.gif|:D|biggie|yes
5|tongue.gif|:p|tongue|yes
---------
See the space, thats what it does when it does, I want that gone.
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