<title>Here is my code and debug run</title> </head> <body>

Here is my code and debug run. This was working previously, and I cannot get the powers that be to admit that they changed anything. Can anyone tell me what I need to add to this code to make it work again, please???
<code><c></code>
use LWP::Debug qw(+);
use HTML::TokeParser;
use URI;
use Date::Simple (':all');
use LWP::UserAgent;
#use Term::ReadKey;
use LWP 5.64;
use Crypt::SSLeay;
my $browser;

my $realm ='Engineering Private Directory (use your unix p/w)';
my $server = '$URL';
my $port = '80';

my $username = "$username";
my $password = "$passwd";
chomp ($password);
$browser=LWP::UserAgent->new;

$browser->env_proxy;
# Now for the **magic**...
$browser->credentials(
'$url:80',
'Engineering Private Directory \(use your unix p/w\)',
'login' => 'passwd'
);

my $url="$url";
my $req = $browser->get($url);
$req->authorization_basic($username, $password);
my $res = $browser->request($req);
print $res->as_string;

my $response = $browser->get($url);
print "Error: ", $response->header('WWW-Authenticate') ||
'Error accessing',
# ('WWW-Authenticate' is the realm-name)
"\n ", $response->status_line, "\n at $url\n Aborting"
unless $response->is_success;
exit;
<code><c></code>
**************************************************************

Debug Output:
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET $URL
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::http::request: GET / HTTP/1.0
Host: $HOST
User-Agent: libwww-perl/5.803

LWP::Protocol::http::request: reading response
LWP::Protocol::http::request: HTTP/1.1 302 Found
Date: Fri, 16 May 2008 14:10:34 GMT
Server: Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.8e DAV/2 PHP/5.2.6
Location: $URL
Content-Length: 335
Connection: close
Content-Type: text/html; charset=iso-8859-1

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="$URL">here</a>.</p>
<hr>
<address>Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.8e DAV/2 PHP/5.2.6 Server at $URL Port 80</address>
</body></html>
LWP::Protocol::http::request: HTTP/1.1 302 Found
LWP::Protocol::collect: read 335 bytes
LWP::UserAgent::request: Simple response: Found
LWP::UserAgent::request: ()
LWP::UserAgent::send_request: GET $URL
LWP::UserAgent::_need_proxy: Not proxied
LWP::Protocol::http::request: ()
LWP::Protocol::http::request: GET / HTTP/1.0
Host: $HOST
User-Agent: libwww-perl/5.803

LWP::Protocol::http::request: reading response
LWP::Protocol::http::request: HTTP/1.1 401 Authorization Required
Date: Fri, 16 May 2008 14:10:37 GMT
Server: Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.8e DAV/2 PHP/5.2.6
WWW-Authenticate: Basic realm="Engineering Private Directory (use your unix p/w)"
Accept-Ranges: bytes
Content-Length: 2968
Connection: close
Content-Type: text/html

LWP::Protocol::http::request: HTTP/1.1 401 Authorization Required
LWP::Protocol::collect: read 2968 bytes
LWP::UserAgent::request: Simple response: Unauthorized
LWP::UserAgent::request: ()
You need a request object, not a HTTP::Response object at trygnats.pl line 48

</body> </html>

In reply to LWP::Credentials help with previously working perl script PLEASE??? by funeeldy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.