use strict; use warnings; use Encode qw( encode ); use HTML::Entities qw( decode_entities ); # This eval should have no effect on subsequent evals. eval encode('utf-8', decode_entities( 'use utf8; my $var_with_♥_non_word;' )); my $string = 'abc'; eval '$string = "def"; 1' or die; if ($string ne 'def') { print("BUG! string should be 'def' but is '$string'\n"); } else { print("No bug\n"); }