Dan Muey wrote:

>Something like ::
>  
> use LWP::Simple;
> my $content = authenticate_and_get($url, $user, $pass);
> print $content;
>  
> IE if you got $url in a browser it will prompt you for your username and
> password.
>  

try:

#!/usr/bin/perl -w
use strict;

use LWP::UserAgent;

my $agent = new LWP::UserAgent;
my $request = new HTTP::Request(GET => 'http://protected/page.html');
   $request->authorization_basic('user','password');
my $respond = $agent->request($request);

if($respond->is_success){
        print "great!\n";
}else{
        print "better luck next time\n";
}

__END__

there is a lot more to auth. this's just the basic.

david

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to