in reply to simple replace question

It removes <p> at the beginning, or </p> at the end of the string, but not both.

You might want to use the /g modifier. Or what I would do:

$testtext =~ s/^<p>//; $testtext =~ s!</p>$!!;

Replies are listed 'Best First'.
Re^2: simple replace question
by jck (Scribe) on Jul 09, 2009 at 22:51 UTC
    JavaFan - thanks! In your second line, the "!"s should be "/"s, right?