noob Date::Manip problems

N

Neuroplexus

I believe that I have correctly installed the date manip module, but
when I try to run the following test script from a browser I get "CGI
Error The specified CGI application misbehaved by not returning a
complete set of HTTP headers"

#!c:/Perl/bin/Perl.exe
use Date::Manip;
print "Content-type: text/html\n\n";
$str = "05/05/05";
$date = &ParseDate($str);

I believe that I have installed the module correctly because I can
print DateManipVersion, but any time I try to use any of the module's
functions I get this error. What am I missing???

Thanks
 
A

A. Sinan Unur

I believe that I have correctly installed the date manip module, but
when I try to run the following test script from a browser I get "CGI
Error The specified CGI application misbehaved by not returning a
complete set of HTTP headers"

#!c:/Perl/bin/Perl.exe
use Date::Manip;
print "Content-type: text/html\n\n";
$str = "05/05/05";
$date = &ParseDate($str);

*Sigh* Did you actually try running the script on the command line?
What am I missing???

Intellectual curiosity.

Sinan
 
M

Mothra

Neuroplexus said:
I believe that I have correctly installed the date manip module, but
when I try to run the following test script from a browser I get "CGI
Error The specified CGI application misbehaved by not returning a
complete set of HTTP headers"
(code snipped)

Try this

use strict;
use warnings;
use CGI;
use Date::Manip;
$ENV{TZ} = 'PST8PST';
my $str = "05/05/05";
my $q = new CGI;
print $q->header,
$q->start_html( &ParseDate($str) ),
$q->end_html;


Hope this helps

Mothra
 
U

usenet

Neuroplexus said:
I believe that I have installed the module correctly because I can
print DateManipVersion, but any time I try to use any of the module's
functions I get this error.

Your script is failing (crashing) and dumping out an error message.
This error message is confusing the browser (because browsers expect
HTML, not error messages). Run your CGI script from the command-line to
see what the message is.

Or add this near the top of your script:
use CGI::Carp qw(fatalsToBrowser);
 

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
474,472
Messages
2,571,834
Members
48,802
Latest member
shadowoftheunknown
Top