How NOT to do it
file: code/BadExample/FindNewSeries.pm 18: sub fetch { 19: my ($self) = @_; 20: 21: my $ua = LWP::UserAgent->new( 22: agent => 'domms new series finder', 23: timeout => 5, 24: ); 25: my $res = $ua->get('http://www.ezrss.it/feed'); 26: if ( $res->is_success ) { 27: return $res->decoded_content; 28: } 29: else { 30: die $res->status_line; 31: } 32: }
LWP::UserAgent is initialised inline