sub new { my $class = shift; my $options = shift; my $self = new LWP::UserAgent; $self->{api_key} = $options->{key}; $self->{api_secret} = $options->{secret}; $self->{rest_uri} = $options->{rest_uri} || 'http://api.flickr.com/services/rest/'; $self->{auth_uri} = $options->{auth_uri} || 'http://api.flickr.com/services/auth/'; eval { require Compress::Zlib; $self->default_header('Accept-Encoding' => 'gzip'); }; warn "You must pass an API key to the constructor" unless defined $self->{api_key}; bless $self, $class; return $self; }