diff Ikariam.pm @ 250:a654d43731f0

implement multi-thread Ikariam::Scanner
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Mon, 17 Nov 2008 00:26:44 +0800
parents 5f6f845bbb1d
children 83e3ce37779d
line wrap: on
line diff
--- a/Ikariam.pm	Mon Nov 17 00:25:56 2008 +0800
+++ b/Ikariam.pm	Mon Nov 17 00:26:44 2008 +0800
@@ -118,16 +118,23 @@
         debug => undef,
     };
 
-
     # if debug
     LWP::Debug::level('+trace');
 
-    $self->{mech}->cookie_jar(HTTP::Cookies->new(file => "/tmp/ikariam-cookies.txt", autosave => 1));
+    $self->{mech}->cookie_jar(HTTP::Cookies->new(file => "/tmp/ikariam-$server-cookies.txt", autosave => 1, ignore_discard => 1));
     $self->{mech}->default_headers->push_header('Accept-Encoding', 'deflate');
  
     return bless $self, $class;
 }
 
+sub clone
+{
+    my $self = shift;
+    my $copy = bless { %$self }, ref $self;  # copy most fields
+
+    $copy;
+}
+
 sub viewAlly
 {
     my $self = shift;