Prototype mismatch under ModPerl::PerlRun

Discussion in 'Perl Misc' started by Brian Wakem, Sep 6, 2005.

  1. Brian Wakem

    Brian Wakem Guest

    I am getting some errors (or is it a warning?) using mod_perl
    (ModPerl::perlRun)

    Prototype mismatch: sub
    ModPerl::ROOT::ModPerl::perlRun::usr_local_apache2_MyScript::gettimeofday:
    none vs () at /usr/lib/perl5/5.8.5/Exporter.pm line 65.


    A number of scripts are producing this error, however each script completes
    its task and outputs exactly what it is expected to output.


    Can I ignore this or does it need my attention?


    --
    Brian Wakem
    Email: http://homepage.ntlworld.com/b.wakem/myemail.png
     
    Brian Wakem, Sep 6, 2005
    #1
    1. Advertising

  2. Brian Wakem

    Paul Lalli Guest

    Brian Wakem wrote:
    > I am getting some errors (or is it a warning?) using mod_perl
    > (ModPerl::perlRun)


    You can answer this question yourself by checking the relevant
    documentation:

    perldoc perldiag
    Prototype mismatch: %s vs %s
    (S unsafe) The subroutine being declared or defined had
    previously been declared or defined with a different
    function prototype.

    The "S" there, as shown at the beginning of the relevant perldoc,
    stands for "Severe Warning"

    > Prototype mismatch: sub
    > ModPerl::ROOT::ModPerl::perlRun::usr_local_apache2_MyScript::gettimeofday:
    > none vs () at /usr/lib/perl5/5.8.5/Exporter.pm line 65.


    Reading the description of the error message, it would seem that the
    subroutine gettimeofday was at one point declared or defined with an
    empty prototype, like so:
    sub gettimeofday();
    OR
    sub gettimeofday() {
    #code here...
    }

    but at another point declared/defined without a prototype, like so
    sub gettimeofday;
    OR
    sub gettimeofday {
    #code here...
    }

    The fact that you're getting this message from within Exporter makes me
    wonder if perhaps you're using two or more modules that both export
    their own gettimeofday subroutine. That, however, is a random guess on
    my part.

    Figure out where the two instances of gettimeofday() are coming from.
    If they refer to the same subroutine, fix the prototypes. If they are
    different subroutines, fix the 'use' or 'import' calls to only import
    one of the two modules' gettimeofday() subroutine.

    > Can I ignore this or does it need my attention?


    I can't imagine ever "ignoring" a warning. One that Perl calls a
    "severe" warning even more so. Find the bug, and fix it.

    Paul Lalli
     
    Paul Lalli, Sep 6, 2005
    #2
    1. Advertising

  3. Brian Wakem

    Brian Wakem Guest

    Paul Lalli wrote:

    > Brian Wakem wrote:
    >> I am getting some errors (or is it a warning?) using mod_perl
    >> (ModPerl::perlRun)

    >
    > You can answer this question yourself by checking the relevant
    > documentation:
    >
    > perldoc perldiag
    > Prototype mismatch: %s vs %s
    > (S unsafe) The subroutine being declared or defined had
    > previously been declared or defined with a different
    > function prototype.
    >
    > The "S" there, as shown at the beginning of the relevant perldoc,
    > stands for "Severe Warning"



    Oh dear.


    >> Prototype mismatch: sub
    >>

    ModPerl::ROOT::ModPerl::perlRun::usr_local_apache2_MyScript::gettimeofday:
    >> none vs () at /usr/lib/perl5/5.8.5/Exporter.pm line 65.

    >
    > Reading the description of the error message, it would seem that the
    > subroutine gettimeofday was at one point declared or defined with an
    > empty prototype, like so:
    > sub gettimeofday();
    > OR
    > sub gettimeofday() {
    > #code here...
    > }
    >
    > but at another point declared/defined without a prototype, like so
    > sub gettimeofday;
    > OR
    > sub gettimeofday {
    > #code here...
    > }
    >
    > The fact that you're getting this message from within Exporter makes me
    > wonder if perhaps you're using two or more modules that both export
    > their own gettimeofday subroutine. That, however, is a random guess on
    > my part.



    It seems I can reproduce the error with just these few lines:-

    #!/usr/bin/perl

    use strict;
    use CGI;
    use Time::HiRes qw( gettimeofday );

    my $query = new CGI;
    print $query->header();
    print "Test\n";

    I do not get the error when it is run under mod_cgi, so I think it must be a
    mod_perl specific warning.


    > Figure out where the two instances of gettimeofday() are coming from.
    > If they refer to the same subroutine, fix the prototypes. If they are
    > different subroutines, fix the 'use' or 'import' calls to only import
    > one of the two modules' gettimeofday() subroutine.
    >
    >> Can I ignore this or does it need my attention?

    >
    > I can't imagine ever "ignoring" a warning. One that Perl calls a
    > "severe" warning even more so. Find the bug, and fix it.
    >
    > Paul Lalli



    Further googling has shown that a number of people have had this problem
    before but there doesn't seem to be a solution. Perhaps its a bug in
    mod_perl?



    --
    Brian Wakem
    Email: http://homepage.ntlworld.com/b.wakem/myemail.png
     
    Brian Wakem, Sep 6, 2005
    #3
  4. Brian Wakem

    Brian Wakem Guest

    Brian Wakem wrote:

    > Further googling has shown that a number of people have had this problem
    > before but there doesn't seem to be a solution. Perhaps its a bug in
    > mod_perl?



    Even further googling has only suggested that it *is* a bug in mod_perl
    (PerlRun, not Registry) and can be safetly ignored.


    --
    Brian Wakem
    Email: http://homepage.ntlworld.com/b.wakem/myemail.png
     
    Brian Wakem, Sep 6, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ian douglas
    Replies:
    0
    Views:
    1,837
    ian douglas
    Aug 19, 2003
  2. it_says_BALLS_on_your forehead
    Replies:
    0
    Views:
    374
    it_says_BALLS_on_your forehead
    Jan 24, 2006
  3. Gabriel
    Replies:
    1
    Views:
    184
    Brian McCauley
    Sep 28, 2006
  4. Replies:
    1
    Views:
    99
    Ben Morrow
    Feb 25, 2008
  5. Krishna Chaitanya

    Confusion in perlrun documentation

    Krishna Chaitanya, Mar 20, 2009, in forum: Perl Misc
    Replies:
    4
    Views:
    87
    Krishna Chaitanya
    Mar 21, 2009
Loading...

Share This Page