From 4cabb5e20c9e4318e969ab0d706abe54b02a7138 Mon Sep 17 00:00:00 2001 From: Ralf Ertzinger Date: Fri, 3 Jun 2011 11:18:47 +0200 Subject: [PATCH] base: Initialize a LWP::UserAgent instance for subclasses to use --- videosite/Base.pm | 4 ++++ 1 file changed, 4 insertions(+) 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); -- 1.8.3.1