Hi im new to perl..I normally code java...but the boss got me trying to fix this issue...

Anyway,we get a news feed that comes in as an xml file...this feed now requires "basic HTTP authentication"...the old feed didint require this , so there was nothing implemented in the code, ...anyway this is the code that's giving me the error..the feed people sent me a username and password....how and where should I implement it??....thanx in advance

my $article_xml_url = $article->getElementsByTagName('XMLPAGEURL')->item(0)->getFirstChild->getNodeValue;
                my $req = HTTP::Request->new( GET => $article_xml_url );
                $req->header('Accept' => 'text/xml');
                my $res = $ua->request($req);

                $res->status_line =~ m/^(\d\d\d) (.*?)$/;
                ($status_code,$status_message) = ($1, $2);
                if ( ! $res->is_success ) {
                        $errors = "Error fetching news article ($article_xml_url) from XML newsfeed: " . $res->status_line . "\n";

Look in the HTTP::Request modules documentation and see if has some authentication method. Or look in the documentation of other modules your script might use, like LWP or LWP::Simple or whatever.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.