[Mimedefang] Globals

Matthew.van.Eerde at hbinc.com Matthew.van.Eerde at hbinc.com
Thu Jul 8 15:03:14 EDT 2004


> From: Rich West [mailto:Rich.West at wesmo.com]
+ my @mailing_lists = ();
> sub get_lists
> {
+    return @mailing_lists if @mailing_lists(); # if already cached in this
slave, return
+    # otherwise look it up
>    open (LISTS, "/var/mailman/bin/list_lists -b|")
>      or die "Could not execute '/var/mailman/bin/list_lists -b'.\n";
>    @lists = <LISTS>;
>    close(LISTS);
+    @mailing_lists = @lists; # cache
>    return (@lists);
> }

It's possible to get fancier - you could have a global $lastgotlistsat to
hold the date/time of the last pull, and re-pull if that was sufficiently
long ago.

Matthew.van.Eerde at hbinc.com                      805.964.4554 x902
Hispanic Business Inc./HireDiversity.com         Software Engineer
perl -e"map{y/a-z/l-za-k/;print}shift" "Jjhi pcdiwtg Ptga wprztg,"



More information about the MIMEDefang mailing list