Not able to use LWP::UserAgent::Authenticated

Not able to use LWP::UserAgent::Authenticated

am 27.12.2005 06:11:22 von Hp

Hi All

when i am trying to use
my $ua = LWP::UserAgent::Authenticated->new( $LOGINID, $PASSWORD );

its giving me error

Can't locate LWP/UserAgent/Authenticated.pm in @INC (@INC contains:
/usr/lib/perl5/5.8.5/i386-linux-thread-multi /usr/lib/perl5/5.8.5
/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.4/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.3/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.2/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.1/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4
/usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl/5.8.2
/usr/lib/perl5/site_perl/5.8.1 /usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.4/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.3/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.2/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.1/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4
/usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl/5.8.2
/usr/lib/perl5/vendor_perl/5.8.1 /usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl .) at test.pl line 12.
BEGIN failed--compilation aborted at test.pl line 12.

i have installed the LWP
please help me out

Re: Not able to use LWP::UserAgent::Authenticated

am 27.12.2005 07:52:31 von John Bokma

"HP" wrote:

> my $ua = LWP::UserAgent::Authenticated->new( $LOGINID, $PASSWORD );
>
> its giving me error

Couldn't find this module on CPAN

> i have installed the LWP

Doesn't seem to be part of LWP.

> please help me out

my $req = HTTP::Request->new( GET => "http://....." );
$req->authorization_basic( "user", "password" );

works for me.

See also perldoc lwpcook
"
ACCESS TO PROTECTED DOCUMENTS

Documents protected by basic authorization can easily be accessed like
this:

use LWP::UserAgent;
$ua = LWP::UserAgent->new;
$req = HTTP::Request->new(GET => 'http://www.linpro.no/secret/');
$req->authorization_basic('aas', 'mypassword');
print $ua->request($req)->as_string;

The other alternative is to provide a subclass of LWP::UserAgent that
overrides the get_basic_credentials() method. Study the lwp-request
program for an example of this."

--
John Small Perl scripts: http://johnbokma.com/perl/
Perl programmer available: http://castleamber.com/
I ploink googlegroups.com :-)

Re: Not able to use LWP::UserAgent::Authenticated

am 28.12.2005 08:32:58 von Hp

Thanks John