Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Ignore ALL characters and delete?

by Wonko the sane (Deacon)
on May 13, 2003 at 20:14 UTC ( #257884=note: print w/replies, xml ) Need Help??


in reply to Ignore ALL characters and delete?

The link is not getting deleted because the pattern is never found in the file.
This is because of the meta characters in the link. To make sure that any special meta characters
are escaped in your regex you need the \Q an \E operators.

Try using this as your regex, then the you should be able to find the link.
if ($list =~ /\Q$link\E/i)

Wonko

Replies are listed 'Best First'.
Re: Re: Ignore ALL characters and delete?
by iamrobj (Initiate) on May 13, 2003 at 22:11 UTC
    Worked perfect, thanks Wonko!

    "eq" did not... why is that?

      The /i modifier makes the pattern match case-insensitive. To get the same effect with eq, you can do something like: if (uc($list) eq uc($link)) {
      Substitute lc for uc if you prefer. Unicode is left as an exercise for the reader.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://257884]
help
Chatterbox?
[MidLifeXis]: :-)
[MidLifeXis]: Not for a few years yet. Kids in school :-)
[LanX]: NQC
[MidLifeXis]: Is there internet access up there on the lakes? If I moved there I would like to be able to fish :-D
[LanX]: Not Quite Canada
[Discipulus]: have you been fired?!?
[LanX]: remote rules, I've been offered jobs in the US with the promise to stay outside
[MidLifeXis]: Nope. Just looking around, as there are multiple culture and business changes in the area I am in.
[MidLifeXis]: not yet, anyway. Who knows. Just do my best and whatever happens happens.
[LanX]: should be even easier for you

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (13)
As of 2017-03-23 12:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (286 votes). Check out past polls.