Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ajt (2546)

  (email not shown publicly)

UK based. Perl, XML/HTTP, SAP, Debian hacker.

  • PerlMonks: ajt []
  • Local LUG: AdamTrickett []
  • Debian Administration: ajt []
  • LinkedIn: drajt []

Journal of ajt (2546)

Saturday April 26, 2003
03:14 PM

HTTP::GHTTP Problems under Win/mod_Perl

[ #11861 ]

I don't know if anyone else uses Matt's HTTP::GHTTP module, especially on Win32, but it's doing odd things that have been driving me mad over the last few weeks. The problem is that under Apache::PerlRun or Apache::Registry when I try and get any page after I've already got one (either within the instance or a previous one) I don't get any content. It's okay under plain CGI and LWP works fine too!

There is a little code snip below, it works fine as a CGI, but fails under mod_Perl. I know mod_Perl is strange on Win32, but I've not updated to the latest Apache/mod_perl 2.x versions yet. The weird thing is that some times if I leave the machine a while and come back it works again, as if the problem was cleared up if I give it enough time.

I don't know much mod_Perl so I could be just missing something dead simple... I'll have to read more of the "scary eagle" book I suppose, and stop messing about on Windows.... ;-)

use strict;
use HTTP::GHTTP 'get';
use CGI;

my $q = CGI->new;
print $q->header, $q->start_html, $q->hr;
for (1..3) {
    my $body = get("http://loutre/");    # a local machine on my home network
    if ($body) {
        print "okay"
    } else {
        print "bad"
    print $q->br;
print $q->hr, $q->end_html;
%ENV =();

Time to try the chili I think, perhaps something will make up for today!

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.