Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Malformed header error

by hemusc (Initiate)
on Jul 14, 2011 at 18:58 UTC ( [id://914414]=perlquestion: print w/replies, xml ) Need Help??

hemusc has asked for the wisdom of the Perl Monks concerning the following question:

Hi, My name is Hemanth and i am very new to perl script. We came across this error when one user trying to run some report. here is the error message - "malformed header from script. Bad header=**** Unable to open the initia: glcashbyfund.pl, referer: http://cgi.portseattle.org/mis/gl/glactivityreportmenu.html". I did compare this script with other working ones and syntax is same. so not sure how i can debud this error. I am very new to this scripting so any help will appreciated. some code snippet from glcashbyfund.pl Let me know if you need any more information. Thanks, Hemanth

#!/usr/bin/perl #===================================================================== +======== # Includes and Parses input to script, e.g. I'net FORM data #===================================================================== +======== use CGI; use CGI::Carp qw(fatalsToBrowser); use Sybase::CTlib; require "/var/www/html/mis/include/cgi-lib.pl"; #require "/var/www/html/mis/include/config_fsprod.inc"; require "/var/www/html/mis/include/config_fsrpt.inc"; &ReadParse;

Replies are listed 'Best First'.
Re: Malformed header error
by ikegami (Patriarch) on Jul 14, 2011 at 21:09 UTC
    "#!" must be the first characters in the file, and they're not.
Re: Malformed header error
by Marshall (Canon) on Jul 14, 2011 at 19:39 UTC
    From what is printed here, the file looks ok as far as format goes. Sometimes there can be a bad character which is not a printable character and that messes things up, but I figure that's unlikely here.

    I would fist look at the permissions on glcashbyfund.pl and make sure that it has appropriate read as well as execute permissions so that it will run when user clicks within this page: http://cgi.portseattle.org/mis/gl/glactivityreportmenu.html.

Re: Malformed header error
by Logicus (Initiate) on Jul 14, 2011 at 20:43 UTC
    You could try running the script from the command line and having a look at the headers it produces, I would be willing to bet that it is spitting out something other than a header prior to the header itself and thus causing the error.
Re: Malformed header error
by mpeppler (Vicar) on Jul 19, 2011 at 09:29 UTC
    The most likely problem is that the environment variables needed by Sybase OpenClient (and so by Sybase::CTlib) aren't defined.

    These should be defined in the http server's config file (SYBASE and maybe LD_LIBRARY_PATH)

    Michael

Re: Malformed header error
by Anonymous Monk on Jul 15, 2011 at 00:42 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://914414]
Approved by Marshall
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-04-18 09:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found