Looking at those errors, all the Prototype mismatch are for Test::More functions. Are you sure that Test::More is compatible with your mod_perl¹ environment? (I did a brief check that verified Test::More isn't immediately incompatible with a simple CGI² environment. But I have no experience with nor access to mod_perl, so I cannot give more details on mod_perl specifics.)

The Premature end of script headers is often seen when there's an error printed out before you've printed the headers. For that, I might recommend changing the order at the top of your script, and add a 'BEGIN' block to enforce headers before it includes other:

use strict; use warnings; BEGIN { $|=1; print "Content-Type:text/html; charset=utf-8\n"; print "Content-Language: utf8;\n\n"; } use lib '/'; use lib '/var/www/lib/'; #push @INC, '/var/www/lib/'; use RegexpCharClassesThai; #Regexp-CharClasses-Thai.pm use utf8; use Test::More;

Also, if you have access to CGI::Carp², try use CGI::Carp qw(fatalsToBrowser);, which might help by putting more info into the browser rather than buried in error logs.

Based on this sequence from your post (code then error message):

use RegexpCharClassesThai; #Regexp-CharClasses-Thai.pm ... my @inthai = &IsThaiLCons; ... Undefined subroutine &ModPerl::ROOT::ModPerl::PerlRun::var_www_cgi_tes +t_2d +thai_2dmod_2epl::IsThaiLCons called at /var/www/cgi/test-thai-mod.pl +line 19.

First, are you sure that RegexpCharClassesThai.pm exists, or is it really at the Regexp-CharClasses-Thai.pm that your comment implies? If the latter, you will need to make sure your use and your module naming match correctly.

Second, if it is loading the module properly, does the module export IsThaiLCons by default, or are you supposed to include it in an export list, like use RegexpCharClassesThai qw/IsThaiLCons/;?

Third: &subname is not the recommended syntax for function calls³. Why not just use my @inthai = IsThaiLCons; -- or, if you are like me and like an indication when something's a function without arguments, my @inthai = IsThaiLCons();?


¹: I assume that having ModPerl in the package hierarchy implies that you're in a mod_perl environment. I could easily be wrong about that.

²: not to be confused with CGI.pm, which I didn't include, nor did you -- this is to head off the people whose knee-jerk reaction to seeing the letters CGI is to say you shouldn't be using that any more.

³: Sorry, I cannot recall a reference for that off the top of my head, and I couldn't find it with a couple minutes of searching. Other monks will be able to point you to the dangers and arguments against calling a subroutine with the &sigil and no argument list.


In reply to Re^7: Listing out the characters included in a character class [v5.38] by pryrt
in thread Listing out the characters included in a character class by Polyglot

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.