in reply to Help with HTML::Entities - decode_entities
For example, this test code:
Time flies like an arrow. Fruit flies like a banana.
Outputs#!/usr/bin/perl use strict; use warnings; use HTML::Entities; print "Content-type: text/html\n\n"; my $str = "Fred's shoe"; _decode_entities($str, { amp => "&", 59 => ";" }, 0); print "<p>$str\n";
even though the docs say<p>Fred's shoe
_decode_entities( $string, \%entity2char, $expand_prefix )
This will in-place replace HTML entities in $string. The %entity2char hash must be provided. Named entities not found in the %entity2char hash are left alone.
Time flies like an arrow. Fruit flies like a banana.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Help with HTML::Entities - decode_entities
by ikegami (Patriarch) on Jul 09, 2010 at 00:29 UTC | |
by punch_card_don (Curate) on Jul 09, 2010 at 00:34 UTC | |
Re^2: Help with HTML::Entities - decode_entities
by Anonymous Monk on Jul 09, 2010 at 00:33 UTC |
In Section
Seekers of Perl Wisdom