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). | [reply] |
ah it make sense now :)
because Flickr::API is a subclass of LWP::UserAgent, i can use the same switches,
in this case proxy.
Works a treat now
thank you :) | [reply] |