in reply to Net::Twitter::Lite::WithAPIv1_1 bad request

apiurl => 'http://api.twitter.com/1.1'

"Sorry, that page doesn’t exist!", so that's wrong. I don't have an apiurl in my working config:

my $twitter = Net::Twitter::Lite::WithAPIv1_1->new( access_token_secret => $config->{TWITTER_ACCESS_SECRET}, consumer_secret => $config->{TWITTER_CONSUMER_SECRET}, access_token => $config->{TWITTER_ACCESS_TOKEN}, consumer_key => $config->{TWITTER_CONSUMER_KEY}, user_agent => 'TwitterBotExample', ssl => 1, );

Update my code was based on this short tutorial.

Update: fixed link.