iamrobj has asked for the wisdom of the Perl Monks concerning the following question:
When I print each link, there is a link printed under it with a link to a script that will delete the link from a text file, except if the link contains certain characters ( ")" "%" "&" blah blah blah), the link is not deleted...
How can I first tell the script to ignore ALL characters and just delete the line?
open (FILE, "links.txt") || Error ('open', 'file'); flock (FILE, 2) || Error ('flock', 'file'); @list=<FILE>; close(FILE); foreach $list(@list) { $count++; if ($list =~ /$link/i) { $count--; splice(@list, $count, 1); open (FILE, ">links.txt") || Error ('open', 'file'); flock (FILE, 2) || Error ('flock', 'file'); print FILE @list; close(FILE); } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Ignore ALL characters and delete?
by Wonko the sane (Curate) on May 13, 2003 at 20:14 UTC | |
by iamrobj (Initiate) on May 13, 2003 at 22:11 UTC | |
by VSarkiss (Monsignor) on May 13, 2003 at 22:44 UTC | |
|
Re: Ignore ALL characters and delete?
by dws (Chancellor) on May 13, 2003 at 20:17 UTC | |
|
Re: Ignore ALL characters and delete?
by hossman (Prior) on May 13, 2003 at 21:11 UTC |