in reply to I need to remove all instances of a particular string.

$somestring =~ s#<TR><TD>&amp;nbsp;</TD></TR>##g; You might want to do some reading up on regexes: perlman:perlre.

Update: Oops! Brain swapped out. Slashes in the regex don't mix well with slashes as delimiters. I substituted #'s for a more felicitous result. Thanks buckaduck and runrig...  

dvergin considers reading perlman:perlre himself.

Replies are listed 'Best First'.
Re: Re: I need to remove all instances of a particular string.
by runrig (Abbot) on Aug 03, 2001 at 03:00 UTC
    Um, those '/' characters are going to cause you trouble, you could use a different s/// delimiter, but probably better just to use quotemeta on the string first:
    my $qmstring = quotemeta('<TR>...etc.'); $somestring =~ s/$qmstring//g;