in reply to Why does perl not mark variable as utf-8?
Try avoid using $a and $b for variable names becourse this is reserved variables in Perl.