Did not return a true value

Discussion in 'Perl Misc' started by narra.madan@gmail.com, Jun 15, 2006.

  1. Guest

    hi,
    i am getting the follwing error when ever i call a module from my pgm..
    #################################################################
    [Thu Jun 15 12:04:29 2006] [error] [client 127.0.0.1] Premature end of
    script headers: Register.pl
    Thu Jun 15 12:04:29 2006] [error] [client 127.0.0.1] Reg_Display.pm did
    not return a true value at W:/cgi-bin/new/Register.pl line 13.
    [Thu Jun 15 12:04:29 2006] [error] [client 127.0.0.1] BEGIN
    failed--compilation aborted at W:/cgi-bin/new/Register.pl line 13.
    ################################################################
    the code is as follows...

    #!c:\perl\bin\perl
    use warnings;
    use strict;
    BEGIN
    {
    unshift(@INC,"/cgi-bin/lib/register");
    };
    use CGI;
    my($cgi);
    use Reg_Display; <-"error occured here"
    $cgi=CGI->new;
    print $cgi->header('text/html');
    print $cgi->start_html;
    print<<"EOT";
    i am in register
    EOT
    &Reg_Display::content_Display();
    print $cgi->end_html;
     
    , Jun 15, 2006
    #1
    1. Advertising

  2. Guest

    wrote:
    > hi,
    > i am getting the follwing error when ever i call a module from my pgm..
    > #################################################################
    > [Thu Jun 15 12:04:29 2006] [error] [client 127.0.0.1] Premature end of
    > script headers: Register.pl
    > Thu Jun 15 12:04:29 2006] [error] [client 127.0.0.1] Reg_Display.pm did
    > not return a true value at W:/cgi-bin/new/Register.pl line 13.


    Every module needs to return a 'true' value, and it seems that
    Reg_Display.pm does not do this. Check the end of this module to see if
    it has the following statement '1;'.. Else add this at the end of the
    module (before any pod documentation).

    This should fix the problem

    Aukjan.
     
    , Jun 15, 2006
    #2
    1. Advertising

  3. > #################################################################
    > [Thu Jun 15 12:04:29 2006] [error] [client 127.0.0.1] Premature end of
    > script headers: Register.pl
    > Thu Jun 15 12:04:29 2006] [error] [client 127.0.0.1] Reg_Display.pm did
    > not return a true value at W:/cgi-bin/new/Register.pl line 13.
    > [Thu Jun 15 12:04:29 2006] [error] [client 127.0.0.1] BEGIN
    > failed--compilation aborted at W:/cgi-bin/new/Register.pl line 13.
    > ################################################################


    possible causes:
    1) Did you end your package with "1;" (without quotes) ? Packages need
    to return a true value...
    2) /cgi-bin usually are web relative paths, you should use system
    relative path (/home/web/www/cgi-bin/...) but it seems it's found, so i
    guess it's there.
    3) Just a suggestions.. pay attention on case-sensitive filesystems...
    ( unshift(@INC,"/cgi-bin/lib/Register")

    Have a nice drink
     
    The Doc on The Rocks, Jun 15, 2006
    #3
    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. Siemel Naran

    Does true ^ true return false?

    Siemel Naran, Jun 17, 2004, in forum: C++
    Replies:
    19
    Views:
    671
    Chris Theis
    Jun 18, 2004
  2. Greenhorn
    Replies:
    15
    Views:
    840
    Keith Thompson
    Mar 6, 2005
  3. bdb112
    Replies:
    45
    Views:
    1,354
    jazbees
    Apr 29, 2009
  4. trans.  (T. Onoma)

    DID YOU KNOW? -- break can return a value?

    trans. (T. Onoma), Oct 18, 2004, in forum: Ruby
    Replies:
    4
    Views:
    93
    trans. (T. Onoma)
    Oct 18, 2004
  5. Daniel Waite
    Replies:
    2
    Views:
    230
    Daniel Waite
    May 2, 2008
Loading...

Share This Page