in reply to Re^5: Listing out the characters included in a character class [v5.38]
in thread Listing out the characters included in a character class
#!/usr/bin/perl
#TEST THAI MODULE
use strict;
use warnings;
use lib '/';
use lib '/var/www/lib/';
#push @INC, '/var/www/lib/';
use RegexpCharClassesThai; #Regexp-CharClasses-Thai.pm
use utf8;
use Test::More;
$|=1;
print "Content-Type:text/html; charset=utf-8\n";
print "Content-Language: utf8;\n\n";
my @inthai = &IsThaiLCons;
my $sample = 'โมดูลนี้เป็นส่วนเสริมคำจำกัดความคลาสอักขระ';
my $part = $sample;
$part =~ s/\p{IsThaiHCons}/H/g;
print <<PAGE;
<html lang="utf8">
<body>
<h3>Checking the Thai module</h3>
PAGE
use_ok('RegexpCharClassesThai');
my $text = 'ข่าวนี้ได้แพร่สะพัดออกไปอย่างรวดเร็ว';
my $syllables = 0;
print "<p>Syllables: $syllables; $text\n";
print "<p>Syllables: $syllables; $text\n";
is( 'ก' =~ /\p{IsKokai}/,1,' Match for "ก" =~ /\p{IsKokai}/<br>');
is( 'ก' =~ /\p{InThai}/,1,' Match for "ก" =~ /\p{InThai}/<br>');
is( 'ก' =~ /\p{InThaiAlpha}/,1,' Match for "ก" =~ /\p{InThaiAlpha}/<br>');
is( 'ก' =~ /\p{InThaiCons}/,1,' Match for "ก" =~ /\p{InThaiCons}/<br>');
isnt( 'ก' =~ /\p{InThaiHCons}/,1,' No match for "ก" =~ /\p{InThaiHCons}/<br>');
is( 'ก' =~ /\p{InThaiMCons}/,1,' Match for "ก" =~ /\p{InThaiMCons}/<br>');
isnt( 'ก' =~ /\p{InThaiLCons}/,1,' No match for "ก" =~ /\p{InThaiLCons}/<br>');
isnt( 'ก' =~ /\p{InThaiDigit}/,1,' No match for "ก" =~ /\p{InThaiDigit}/<br>');
isnt( 'ก' =~ /\p{InThaiTone}/,1,' No match for "ก" =~ /\p{InThaiTone}/<br>');
isnt( 'ก' =~ /\p{InThaiVowel}/,1,' No match for "ก" =~ /\p{InThaiVowel}/<br>');
isnt( 'ก' =~ /\p{InThaiCompVowel}/,1,' No match for "ก" =~ /\p{InThaiCompVowel}/<br>');
isnt( 'ก' =~ /\p{InThaiPreVowel}/,1,' No match for "ก" =~ /\p{InThaiPreVowel}/<br>');
isnt( 'ก' =~ /\p{InThaiPostVowel}/,1,' No match for "ก" =~ /\p{InThaiPostVowel}/<br>');
isnt( 'ก' =~ /\p{InThaiPunct}/,1,' No match for "ก" =~ /\p{InThaiPunct}/<br>');
is( 'ก' =~ /\p{InThaiFinCons}/,1,' Match for "ก" =~ /\p{InThaiFinCons}/<br>');
isnt( 'ก' =~ /\p{InThaiMute}/,1,' Match for "ก" =~ /\p{InThaiMute}/<br>');
is( 'ไ' =~ /\p{InThai}/,1,' Match for "ไ" =~ /\p{InThai}/<br>');
is( 'ไ' =~ /\p{InThaiAlpha}/,1,' Match for "ไ" =~ /\p{InThaiAlpha}/<br>');
isnt( 'ไ' =~ /\p{InThaiCons}/,1,' No match for "ไ" =~ /\p{InThaiCons}/<br>');
isnt( 'ไ' =~ /\p{InThaiHCons}/,1,' No match for "ไ" =~ /\p{InThaiHCons}/<br>');
isnt( 'ไ' =~ /\p{InThaiMCons}/,1,' No match for "ไ" =~ /\p{InThaiMCons}/<br>');
isnt( 'ไ' =~ /\p{InThaiLCons}/,1,' No match for "ไ" =~ /\p{InThaiLCons}/<br>');
isnt( 'ไ' =~ /\p{InThaiDigit}/,1,' No match for "ไ" =~ /\p{InThaiDigit}/<br>');
isnt( 'ไ' =~ /\p{InThaiTone}/,1,' No match for "ไ" =~ /\p{InThaiTone}/<br>');
is( 'ไ' =~ /\p{InThaiVowel}/,1,' Match for "ไ" =~ /\p{InThaiVowel}/<br>');
isnt( 'ไ' =~ /\p{InThaiCompVowel}/,1,' No match for "ไ" =~ /\p{InThaiCompVowel}/<br>');
is( 'ไ' =~ /\p{InThaiPreVowel}/,1,' Match for "ไ" =~ /\p{InThaiPreVowel}/<br>');
isnt( 'ไ' =~ /\p{InThaiPostVowel}/,1,' No match for "ไ" =~ /\p{InThaiPostVowel}/<br>');
isnt( 'ไ' =~ /\p{InThaiPunct}/,1,' No match for "ไ" =~ /\p{InThaiPunct}/<br>');
is( 'ไ' =~ /\p{IsSaraaimaimalai}/,1,' Match for "ไ" =~ /\p{IsSaraaimaimalai}/<br>');
print "\n";
print <<PAGE;
<h3>Check:</h3>
<p>InThai: @inthai</p>
<p>Sample: $sample</p>
<p>Part: $part</p>
<p>PATH: $ENV{PATH}</p>
<p>INC: @INC</p>
</body>
</html>
PAGE
And then the error messages...
Prototype mismatch: sub ModPerl::ROOT::ModPerl::PerlRun::var_www_cgi_t +est_2dthai_2dmod_2epl::ok: none vs ($;$) at /usr/share/perl/5.34/Expo +rter.pm line 63. at /var/www/cgi/test-thai-mod.pl line 12. Prototype mismatch: sub ModPerl::ROOT::ModPerl::PerlRun::var_www_cgi_t +est_2dthai_2dmod_2epl::use_ok: none vs ($;@) at /usr/share/perl/5.34/ +Exporter.pm line 63. at /var/www/cgi/test-thai-mod.pl line 12. Prototype mismatch: sub ModPerl::ROOT::ModPerl::PerlRun::var_www_cgi_t +est_2dthai_2dmod_2epl::require_ok: none vs ($) at /usr/share/perl/5.3 +4/Exporter.pm line 63. at /var/www/cgi/test-thai-mod.pl line 12. Prototype mismatch: sub ModPerl::ROOT::ModPerl::PerlRun::var_www_cgi_t +est_2dthai_2dmod_2epl::is: none vs ($$;$) at /usr/share/perl/5.34/Exp +orter.pm line 63. at /var/www/cgi/test-thai-mod.pl line 12. Prototype mismatch: sub ModPerl::ROOT::ModPerl::PerlRun::var_www_cgi_t +est_2dthai_2dmod_2epl::isnt: none vs ($$;$) at /usr/share/perl/5.34/E +xporter.pm line 63. at /var/www/cgi/test-thai-mod.pl line 12. Prototype mismatch: sub ModPerl::ROOT::ModPerl::PerlRun::var_www_cgi_t +est_2dthai_2dmod_2epl::like: none vs ($$;$) at /usr/share/perl/5.34/E +xporter.pm line 63. at /var/www/cgi/test-thai-mod.pl line 12. Prototype mismatch: sub ModPerl::ROOT::ModPerl::PerlRun::var_www_cgi_t +est_2dthai_2dmod_2epl::unlike: none vs ($$;$) at /usr/share/perl/5.34 +/Exporter.pm line 63. at /var/www/cgi/test-thai-mod.pl line 12. Prototype mismatch: sub ModPerl::ROOT::ModPerl::PerlRun::var_www_cgi_t +est_2dthai_2dmod_2epl::cmp_ok: none vs ($$$;$) at /usr/share/perl/5.3 +4/Exporter.pm line 63. at /var/www/cgi/test-thai-mod.pl line 12. Prototype mismatch: sub ModPerl::ROOT::ModPerl::PerlRun::var_www_cgi_t +est_2dthai_2dmod_2epl::pass: none vs (;$) at /usr/share/perl/5.34/Exp +orter.pm line 63. at /var/www/cgi/test-thai-mod.pl line 12. Prototype mismatch: sub ModPerl::ROOT::ModPerl::PerlRun::var_www_cgi_t +est_2dthai_2dmod_2epl::fail: none vs (;$) at /usr/share/perl/5.34/Exp +orter.pm line 63. at /var/www/cgi/test-thai-mod.pl line 12. Prototype mismatch: sub ModPerl::ROOT::ModPerl::PerlRun::var_www_cgi_t +est_2dthai_2dmod_2epl::can_ok: none vs ($@) at /usr/share/perl/5.34/E +xporter.pm line 63. at /var/www/cgi/test-thai-mod.pl line 12. Prototype mismatch: sub ModPerl::ROOT::ModPerl::PerlRun::var_www_cgi_t +est_2dthai_2dmod_2epl::isa_ok: none vs ($$;$) at /usr/share/perl/5.34 +/Exporter.pm line 63. at /var/www/cgi/test-thai-mod.pl line 12. [Mon Oct 30 13:00:32.189740 2023] [core:error] [pid 188075:tid 1396601 +72908096] [client 192.168.1.101:55600] Premature end of script header +s: test-thai-mod.pl [Mon Oct 30 13:00:32.189767 2023] [perl:warn] [pid 188075:tid 13966017 +2908096] /cgi/test-thai-mod.pl did not send an HTTP header [Mon Oct 30 13:00:32.189819 2023] [:error] [pid 188075:tid 13966017290 +8096] Undefined subroutine &ModPerl::ROOT::ModPerl::PerlRun::var_www_ +cgi_test_2dthai_2dmod_2epl::IsThaiLCons called at /var/www/cgi/test-t +hai-mod.pl line 19.\n
Blessings,
~Polyglot~
|
|---|