File Coverage

blib/lib/Wetware/llyrisWeb.pm
Criterion Covered Total %
statement 18 34 52.9
branch 0 4 0.0
condition 0 3 0.0
subroutine 6 8 75.0
pod 0 2 0.0
total 24 51 47.0


line stmt bran cond sub pod time code
1             package Wetware::llyrisWeb;
2              
3 1     1   6551 use 5.006;
  1         3  
  1         42  
4 1     1   5 use strict;
  1         1  
  1         32  
5 1     1   5 use warnings;
  1         7  
  1         47  
6              
7             require Exporter;
8 1     1   864 use AutoLoader qw(AUTOLOAD);
  1         1882  
  1         7  
9              
10             our @ISA = qw(Exporter);
11              
12 1     1   493069 use CGI qw/:standard/;
  1         29445  
  1         9  
13              
14             # This allows declaration use Wetware::llyrisWeb ':all';
15             # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
16             # will save memory.
17             # dtk_lyris_init dtk_lyris_get_players
18             # parse_cmd_line
19             our %EXPORT_TAGS = ( 'all' => [ qw(
20             dtk_show_query_page show_answerPage
21             ) ] );
22              
23             our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
24              
25             our @EXPORT = qw(
26            
27             );
28             our $VERSION = '0.01';
29              
30 1     1   4349 use vars qw/@lyris_mailing_lists/ ;
  1         2  
  1         694  
31              
32             # Preloaded methods go here.
33              
34             #-----------------------
35             # dtk_lyris_init - used to initialize the lyris stuff and set lists to check
36             # this is skanky Hiding a Require inside of the sub - but for the moment
37             # it allows us to do other games
38             # as an TODO thing - we may want to load the security stuff here
39             # so that we return only those lists that the person is allowed to
40             # see to begin with - rather than them all -
41              
42             sub dtk_lyris_init {
43              
44 0     0 0   require 'lyrislib.pl';
45 0           &lyris::init;
46            
47             #
48             # we really need something that based upon the user
49             # to select the Right Lists - something with
50             # $user = $ENV{'REMOTE_USER'};
51              
52 0           @lyris_mailing_lists=&lyris::ListAll;
53            
54             } # end sub dtk_lyris_init
55              
56             #-----------------------
57             # dtk_lyris_get_players - check the lists to see if a player is in it
58             # return the Hash of things that were found
59              
60             sub dtk_lyris_get_players {
61              
62 0     0 0   my ($name) = @_;
63              
64 0           my %retHash = ();
65              
66 0           my @players = ();
67            
68 0           dtk_lyris_init;
69              
70 0           foreach my $list_name (@lyris_mailing_lists) {
71 0           my %fields = &lyris::MemberAllNameEmail($list_name);
72 0           while ( my ($key, $val) = each %fields ) {
73 0 0 0       push(@players, ( $key , $val ) )
74             if ( $key =~ m/$name/i or $val =~ m/$name/i );
75             }
76              
77             # now the funk
78 0 0         if (@players) {
79 0           my %tmpHash = @players;
80 0           $retHash{ $list_name } = \%tmpHash;
81 0           @players = ();
82             }
83             } # end the foreach
84              
85 0           %retHash ;
86              
87             } # end dtk_lyris_get_players
88              
89              
90             # Autoload methods go after =cut, and are processed by the autosplit program.
91              
92             1;
93             __END__