# HTML::Entities
# First there's a whole lot of POD here, but since I already saw the HTML
# version of that (which wasn't very helpful) I don't really care.
# Hey, cool. The actual module begins here.
use strict;
use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION);
use vars qw(%entity2char %char2entity);
# Bla bla bla. Oh, wait, that last line looks promising.
# Some more stuff for Exporter happens next. I don't care.
%entity2char = (
# What follows is a long, long, long mapping of character names
# to actual characters.
# This list goes on and on and on... Never knew there were so many!
);
# Then, suddenly:
# Make the opposite mapping
while (my($entity, $char) = each(%entity2char)) {
$entity =~ s/;\z//;
$char2entity{$char} = "&$entity;";
}
delete $char2entity{"'"}; # only one-way decoding