in reply to help substituting whitespaces?

Does your conversion of &nbsp; work? also you may get spurious mulit-spaces, esp if there was &nbsp;&nbsp;<hr>&nbsp;&nbsp; in the string.

So i'd put the 'clear multi-spaces' step last in that group to cover that, as for that step...
any of
$description =~ s/\s*/ /s; $description =~ s/\s+/ /s;
should work AFAIK, i don't think the 's' modifier at the end is strictly needed, Which variation have you tried? And are you just trying to replace multi-spaces with single ones at that step? Try a debug by replacing with a hyphen instead?

Perhaps more questions than answers, but may be of some use?!

Replies are listed 'Best First'.
Re: Re: help substituting whitespaces?
by Abstraction (Friar) on Aug 07, 2003 at 14:29 UTC
    Try replacing the /s with a /g.
    $description =~ s/\s+/ /g;
      Ah -- dat's it. Global is what did it. I had the /s stuck in there from a while back (copy and paste) and totally forgot about it, and 'global' totally slipped my mind in the process. Fantastic -- as always, the help is much appreciated. If this lesson has taught me one thing, it's to adhere strictly to a template... it's been driving me nuts getting this stuff cleaned up. :) PS - I finally registered. I'm the anonymous monk that posted.