Question

I am trying to test Twitter Module of Perl for some work and facing the mentioned subject line while running it. The system where I am running it is AIX and Perl version is 5.8.8

Code.

#!/usr/bin/perl -w
use Net::Twitter::Lite;
use Scalar::Util 'blessed';
use strict;
require LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$ua->env_proxy;


my $consumer_key = "ck";
my $consumer_secret = "cs";
my $access_key = "ak";
my $access_secret = "as";


my $nt = Net::Twitter::Lite->new(
    consumer_key        => $consumer_key,
    consumer_secret     => $consumer_secret,
    access_token        => $access_key,
    access_token_secret => $access_secret,
);

$nt->update("Status Update from Perl!");

Error:

Can't locate object method "default_header" via package "LWP::UserAgent"
   at /ts/vb/perl5/lib/perl5/Net/Twitter/Lite.pm line 104.
Was it helpful?

Solution

Net::Twitter::Lite is probably using a feature that that was added to LWP::UserAgent in a later version than the one you have installed. Upgrade LWP::UserAgent.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top