Discussion:
Did not return a true value
(too old to reply)
n***@gmail.com
2006-06-15 06:39:10 UTC
Permalink
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;
a***@gmail.com
2006-06-15 07:32:38 UTC
Permalink
Post by n***@gmail.com
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.
The Doc on The Rocks
2006-06-15 11:35:51 UTC
Permalink
Post by n***@gmail.com
#################################################################
[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

Loading...