YarNik has asked for the wisdom of the Perl Monks concerning the following question:
In Perl v5.10.1 I did not declare utf8 for require scripts, but in Perl v5.16.3 it is necessary.
What is another solution, do not change a lot of require scripts?
Now my index.pl script looks like this:
#!/usr/bin/perl use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use utf8; use CGI qw/:standard -utf8 -nosticky/; use open qw/:utf8/; binmode(STDOUT, ":utf8"); print header(-type => 'text/html',-charset => 'UTF-8'); print "one один\n"; require "index_req.pl"; print @select;index_req.pl
#!/usr/bin/perl @select = qw(one один); 1;output:
one один one????????if I add utf8 in index_req.pl
#!/usr/bin/perl use utf8; @select = qw(one один); 1;then output is good:
one один oneодин
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: utf8 for require scripts
by haukex (Archbishop) on Dec 23, 2019 at 13:32 UTC | |
by YarNik (Sexton) on Dec 23, 2019 at 13:40 UTC | |
|
Re: utf8 for require scripts (updated)
by haukex (Archbishop) on Dec 23, 2019 at 11:25 UTC | |
by YarNik (Sexton) on Dec 23, 2019 at 12:38 UTC |