in reply to Help for "Cannot decode string with wide characters..." and CGI.pm

When you use utf8;, then your string literals are text strings. But this
my $referer_url = "@{[ $q->url ]}";

tries to interpolate an URL, and that seems to be a byte string. Simply mixing those two is a very bad idea.

I don't see why you do it in this complicated way anyway. What's wrong with

my $url = $q->url;

or maybe

my $url = decode_utf8 $q->url;

depending on how you want to use it.