in reply to character encoding ambiguities when performing regexps with html entities
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");
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: character encoding ambiguities when performing regexps with html entities
by angelixd (Novice) on Sep 24, 2007 at 19:27 UTC | |
by graff (Chancellor) on Sep 24, 2007 at 22:27 UTC |