in reply to Re: Flickr::API and using a proxy
in thread Flickr::API and using a proxy

Exactly! The LWP object ($ua) had the proxy set, and then the code creates a completely different object in $api.

This is why setting the proxy on $api works: Flickr::API is a subclass of LWP::UserAgent - so any method that LWP::UserAgent has, Flickr::API has (subject to Flickr::API overriding said method).

To speak metaphorically, if LWP ::UserAgent was a quart of milk, and Flickr::API a quart of chocolate milk, you poured a glass of milk ($ua = LWP::UserAgent->new) and a glass of chocolate milk ($api = Flickr::API->new()), put a straw in the glass of milk (setting up the proxy on $ua), and then couldn't drink the chocolate milk because it didn't have a straw in it (you needed to call the proxy() method on $api).