CGI::Listman - Easily managing web subscribtion lists
use CGI::Listman;
CGI::Listman provides an object-oriented interface to easily manage web-based subscribtion lists. It implements concepts such as "dictionaries", "selections", "exporters", provides some checking facilities (field duplication or requirements) and uses the DBI interface so as to provide a backend-independent storage area (PostgreSQL, ...).
The CGI::Listman class manages the listmanagers of your project. This is the very first class you want to instantiate. It is the logical central point of all others objects. Except for CGI::Listman::line, CGI::Listman::exporter and CGI::Listman::selection, you should not call any other class's "new" method since CGI::Listman will handle its own instances for you.
As for any perl class, new acts as the constructor for an instance of this class. It has three optional arguments that, if not specified, can be replaced with calls to the respective methods: set_backend, set_list_name, set_list_directory.
All the parameters are optional with this method.
A string representing the DBI backend to be used. (Warning: only "CSV" and "mysql" are supported at this time.)
A string representing the base filename for the dictionary and the storage file (for the CVS backend).
A string representing the directory where the list data will be stored.
A reference to a blessed instance of CGI::Listman.
my $list_manager = CGI::Listman->new; # creates a simple list # manager without any # arguments
# creates a list manager by specifying the backend, the filename # and the storage directory my $list_manager = CGI::Listman->new ('CSV', 'userlist', '/var/lib/weblists');
Defines the DBI backend used to store the list data.
A string representing the DBI backend. As noted before only 'CSV' and 'mysql' are currently supported. More will be supported in the future.
This method returns nothing.
Defines the database where the list data has to be stored.
A string representing the database name. This information is required for non-file-based storage databases.
Defines the username and password needed to connect to the database.
A string representing the username.
A string representing the password.
Defines the hostname and port where the database resides. The use of this function might not absolutely be needed. For example, the "mysql" backend default's host is "localhost". So if your database is stored on the same machine as your webserver, you will not need to use this function.
A string representing the hostname of the machine your database engine is running on.
An integer representing the TCP/IP port your database daemon is listening on.
Gives a name to your list.
A string representing the name of your list, which it turns define the base name for various storage files. The name of the list's dictionary (see CGI::Listman::dictionary) will be deduced from it as well as its CSV "database" file if ever.
Defines where the list's dictionary and data files are stored.
A string representing the directory where this instance of CGI::Listman will have its data files stored.
For "real" (i.e. everything except "CSV") database backends, gives the name of the table the list is stored into. If not called, the list name will be used.
A string representing the table name of your list for use with databases.
Obtain the dictionary of this instance (there is only one dictionary for each instance). This method will automatically create and read the list's dictionary for you if needed.
This method takes no parameter.
A reference to an instance of CGI::Listman::dictionary.
Returns the n'th CGI::Listman::line of this instance.
An integer representing the requested CGI::Listman::line.
A reference to an instance of CGI::Listman::line.
Add a CGI::Listman::line (see CGI::Listman::line to this instance's list of lines.
An instance of CGI::Listman::line to be added to this list manager.
Loads the line from the list database or storage file. This function is deprecated and will probably be removed or made private in a later release.
This method takes no argument.
Returns a reference to an ARRAY of the list's lines. This method takes care of preloading the list from the database if needed.
A reference to the ARRAY of CGI::Listman::line of this list manager object.
This method checks the presence in the hash ref of keys that are marked as mandatory in the instance's dictionary. It returns two ARRAY references, the first of which lists the missing mandatory fields, the second being a list of the fields that are not present in the dictionary.
A reference to a HASH whereof the keys are the names CGI fields.
A reference to an array of mandatory fields (see CGI::Listman::dictionary::term that were missing from parameters_hashref.
A reference to an array of "unknown fields". That is, fields that were part of parameters_hashref but that were not found in the dictionary.
This method commits any changes made to your instance, after which, that instance will be invalidated. As long as it is not called, you can of course apply any modifications to your instance. This limitation will probably be got rid of in a next release.
Delete a CGI::Listman::line from this instance's list of lines.
An instance of CGI::Listman::line to be removed from this list manager.
Delete many lines at the same time through the use of a CGI::Listman::selection (see CGI::Listman::selection).
An instance of CGI::Listman::selection made of lines to be removed from this list manager.
Wolfgang Sourdeau, <Wolfgang@Contre.COM>
Copyright (C) 2002 iScream multimédia <info@iScream.ca>
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
CGI::Listman::line(3) CGI::Listman::exporter(3) CGI::Listman::dictionary(3) CGI::Listman::dictionary::term(3) CGI::Listman::selection(3)
DBI(3), CGI(3)
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'multimédia'. Assuming CP1252
To install CGI::Listman, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CGI::Listman
CPAN shell
perl -MCPAN -e shell install CGI::Listman
For more information on module installation, please visit the detailed CPAN module installation guide.