What happens to $text afterwards?
As you can see if you view the produced HTML doc in your web browser, the bit you provided works fine.
my %allowed_text_code = ( '$\\alpha$' => 'α', '$\\beta$' => 'β', '$\\gamma$' => 'γ', '$\\delta$' => 'δ', '$\\theta$' => 'θ', '$\\pi$' => 'π', '\\degrees' => '°' ); my $text = join '', keys %allowed_text_code; foreach my $tex_key (keys %allowed_text_code) { $text =~ s/\Q$tex_key\E/$allowed_text_code{$tex_key}/g; } open(my $fh, '>', 'temp.html') or die; print $fh ("$text\n");
In reply to Re: character encoding ambiguities when performing regexps with html entities
by ikegami
in thread character encoding ambiguities when performing regexps with html entities
by angelixd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |