Did not return a true value

N

narra.madan

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

aukjan

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.
 
T

The Doc on The Rocks

#################################################################
[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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top