Ah, understood. OK, that reduces the number of required changes a lot. :)
Regarding Mojolicious (or other CGI.pm alternatives). Yes, I know it's bad to CGI.pm. But basically I really haven't found any alternative. I don't need frameworks to write applications and I don't need templates because I (as you've seen) I use Perl to write HTML. I only use CGI.pm to print out websites, so all the other neat features are totally wasted on me. And my main problem would be that I'd have to spend months to migrate everything I wrote over the past decades to the new system. At least CGI.pm isn't completely abandoned. The last update was beginning of January.
Adjusted to this now:
test3.pl:
#!/usr/bin/perl -w
use strict;
use lib "/home/digioso/web/digioso.tk/stuff";
use Navi2;
binmode STDOUT, ":utf8";
Navi2::print_navi();
print "test";
Navi2::end_navi();
Navi2.pm:
#!/usr/bin/perl -w
use strict;
use warnings;
use CGI;
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
package Navi2;
1;
sub create_cgi
{
binmode STDOUT, ":utf8";
return new CGI;
}
sub print_navi()
{
my $cgi = create_cgi();
print $cgi->header (-type => 'text/html', -charset => 'UTF-8');
}
sub end_navi()
{
my $cgi = create_cgi();
print $cgi->end_html;
}