Hello

I'am new on this list and don't know how patch are submitted, but I'd 
like to know if it could be possible to take into account the kind of 
enhancement I made for my own. I was needing a way to pass a user data 
to the scan method called for cookie jar scanning. Here is the patch. 
Please tell me your feelings about it.

-- 
                   Remi Cohen-Scali
<[EMAIL PROTECTED]>          <[EMAIL PROTECTED]>

diff -u libwww-perl-5.53/lib/HTTP/Cookies.pm.old libwww-perl-5.53/lib/HTTP/Cookies.pm
--- libwww-perl-5.53/lib/HTTP/Cookies.pm.old    Fri Apr  6 22:13:25 2001
+++ libwww-perl-5.53/lib/HTTP/Cookies.pm        Fri Jul 20 03:09:45 2001
@@ -569,29 +569,32 @@
 }
 
 
-=item $cookie_jar->scan( \&callback );
+=item $cookie_jar->scan( \&callback, $UserData );
 
 The argument is a subroutine that will be invoked for each cookie
 stored in the $cookie_jar.  The subroutine will be invoked with
 the following arguments:
 
-  0  version
-  1  key
-  2  val
-  3  path
-  4  domain
-  5  port
-  6  path_spec
-  7  secure
-  8  expires
-  9  discard
- 10  hash
+
+  0 user data 
+  1 version    
+  2 key       
+  3 val       
+  4 path      
+  5 domain    
+  6 port      
+  7 path_spec 
+  8 secure    
+  9 expires   
+ 10 discard   
+ 11 hash     
 
 =cut
 
 sub scan
 {
-    my($self, $cb) = @_;
+    my($self, $cb, $ud) = @_;
+    $ud = '' unless (defined $ud);
     my($domain,$path,$key);
     for $domain (sort keys %{$self->{COOKIES}}) {
        for $path (sort keys %{$self->{COOKIES}{$domain}}) {
@@ -600,7 +603,7 @@
                   $secure,$expires,$discard,$rest) =
                       @{$self->{COOKIES}{$domain}{$path}{$key}};
                $rest = {} unless defined($rest);
-               &$cb($version,$key,$val,$path,$domain,$port,
+               &$cb($ud, $version,$key,$val,$path,$domain,$port,
                     $path_spec,$secure,$expires,$discard,$rest);
            }
        }

Reply via email to