in reply to Help with HTML::Entities - decode_entities

Even if it was possible to do what you want with HTML::Entities — and it looks like you can't — It would make most sense to just use

$mystring =~ s/&#59;/;/g; $mystring =~ s/&/&/g;

That said, decoding "&" without decoding all other entities creates garbage. For example

é

and

é

are clearly not equivalent, but they produce the same string under your requirements.

Replies are listed 'Best First'.
Re^2: Help with HTML::Entities - decode_entities
by punch_card_don (Curate) on Jul 09, 2010 at 00:38 UTC
    You've inferred the problem I'm tryuing to solve. Recursive use of encode_entities has filled a db with entries like é, which display, as you say, like garbage in the client. Was hoping to just de-decode them before output, but we'll go regex.

    Thanks again.




    Time flies like an arrow. Fruit flies like a banana.