How to do it - attributes
file: code/Attributes/FindNewSeries.pm 34: sub fetch { 35: my ($self) = @_; 36: 37: my $res = $self->ua->get('http://www.ezrss.it/feed'); 38: if ( $res->is_success ) { 39: return $res->decoded_content; 40: } 41: else { 42: die $res->status_line; 43: } 44: }
and now we can access LWP::UserAgent as an attribute of our object