From: Ralf Ertzinger Date: Fri, 3 Jun 2011 09:18:47 +0000 (+0200) Subject: base: Initialize a LWP::UserAgent instance for subclasses to use X-Git-Url: https://git.camperquake.de/gitweb.cgi?p=videosite.git;a=commitdiff_plain;h=4cabb5e20c9e4318e969ab0d706abe54b02a7138 base: Initialize a LWP::UserAgent instance for subclasses to use --- diff --git a/videosite/Base.pm b/videosite/Base.pm index d6c022a..93ac841 100644 --- a/videosite/Base.pm +++ b/videosite/Base.pm @@ -4,11 +4,15 @@ package videosite::Base; use strict; +use LWP::UserAgent; +use HTTP::Cookies; use Data::Dumper; sub new { my $class = shift; my $self = {'_DEBUG' => 0, '_OUT' => sub {print shift}}; + + $self->{_ua} = LWP::UserAgent->new('agent' => 'Mozilla/5.0', 'cookie_jar' => HTTP::Cookies->new); bless($self, $class);