in reply to Using LWP::Debug conns() function

Looking for LWP::Debug::conns (I have lwp 5.803), I see it appear in LWP::Protocol::http (commented out) and LWP::Protocol::http10 (often used). My little test shows no output
perl -MLWP::Debug=+conns -MLWP::Simple -e get(shift) http://perl.org
After looking at the LWP documentation, I enable PERL_LWP_USE_HTTP_10, and try again, and again no output.

Then I remember LWP::Simple is simple (grrr), so I adapt your sample and try again (oy)

#!/usr/bin/perl -w use strict; use LWP; use LWP::Debug qw(+conns); local $ENV{PERL_LWP_USE_HTTP_10} = 1; my $agent = LWP::UserAgent->new(); my $url = 'http://www.perlmonks.org'; my $response = $agent->get($url);
and this time it works :)

I would(you should) ask the author/maintainer about this, as it looks like something he's overlooked.

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re^2: Using LWP::Debug conns() function
by nysus (Parson) on Nov 19, 2005 at 21:29 UTC
    Thanks for the help. But setting that environment variable did not help. I still get no output. I'm using version 5.8.4. Correction: Like you, I'm also using 5.803.

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon";
    $nysus = $PM . $MCF;
    Click here if you love Perl Monks

Re^2: Using LWP::Debug conns() function
by nysus (Parson) on Nov 19, 2005 at 21:39 UTC
    Hmmm...on a whim I uncommented the line in http.pm you mentioned and now I can see the headers sent by the client. I don't see anything else, however. It works both with and without the $ENV variable setting. So that line doesn't seem to have an affect for me.

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon";
    $nysus = $PM . $MCF;
    Click here if you love Perl Monks