NAME

Liz::CounterSet - CounterSet module


SYNOPSIS

 use Liz::CounterSet;

 $counterset = new Liz::CounterSet;


EXAMPLES

 #!/usr/local/bin/perl

 use Liz::CounterSet;


DESCRIPTION

The Liz::CounterSet package allows for very simple countersets kept in the client database.


CLASS METHODS

The following methods can be called without an object specification, but as a class method such as Liz::CounterSet->method().


countersets

Return list of counterset identification names of all countersets in the database specified. Usually not called by itself, but rather incorporated inside a Client Module.

Input Parameters

 1 wildcard specification to match
   (default: all)
 2 Liz::SQL compatible handle or reference to routine that performs connect
   (default: &Connect from caller's namespace)
Output Parameters

 1 reference to list of identification names in the current database
 2 reference to hash with full names
Example

 $counterset = $hn->CounterSet( 'technology' );
Example

 $hn = new HN;
 ($id,$name) = $hn->CounterSets;
 $countersets = @{$id};
 print "All $countersets countersets in Hospitality Net:\n";
 foreach( 0..$#$id ) {
   print " CounterSet '$$name[$_]' ($$id[$_])\n";
 }

In HN.pm:

 sub CounterSets { Liz::CounterSet->countersets( $_[1],$_[0] ) }


new

Create a new Liz::CounterSet object. Creates connection or re-establishes connection with the MySQL database. Usually not called by itself, but rather incorporated inside a Client Module.

Input Parameters

 1 identification name of counterset
   (default: default counterset for database)
 2 Liz::SQL compatible handle or reference to routine that performs connect
   (default: &Connect from caller's namespace)
Output Parameters

 1 instantiated object
Example

 $hn = new HN;
 $counterset = $hn->CounterSet( 'technology' );

In HN.pm:

 sub CounterSet { Liz::CounterSet->new( $_[1],$_[0] ) }


CONTENT METHODS

The following methods allow changes to information that is associated with an entire counterset.


Count

Count a reference to a string, usually the name of the page on the filesystem (as known by $ENV{'SCRIPT_FILENAME'}).

Input Parameters

 1 value to set
   (default: one more than current)
 2 reference to count for
   (default: $ENV{'SCRIPT_FILENAME'})
Output Parameters

 1 current value
 2 timestamp when counterset was created
 3 timestamp when counterset was updated (now)
Example

 $hn = new HN;
 $counterset = $hn->CounterSet( 'technology' );
 $seen = $counterset->Count;


AUTHORS

Elizabeth Mattijsen ( lizperl@INC.nl )


COPYRIGHT

(C) 1998-1999 International Network Consultants


HISTORY

Version 0.17, 30 September 1999

Now no longer puts Exporter in ISA: it wasn't necessary.

Version 0.16, 17 August 1999

Method countersets now reduced to a call to Liz::SQL's ``sets''.

Method new now calls Liz::SQL's ``new'' to create object.

Version 0.15, 9 July 1999

Changed CREATE TABLE to a call to the new Liz::SQL 'create' method.

Changed to new source typography.

Version 0.14, 23 June 1999

Changed from using method ``Exists'' to ``Count'' in method new to determine whether a table exists or not.

Version 0.13, 7 January 1999

Fixed problem in countersets which would prevent the counterset with the default identification name.

Version 0.12, 13 October 1998

Fixed problem introduced on October 6th.

Version 0.11, 6 October 1998

Reduced memory footprint by fully qualifying global variables.

Version 0.1, 27 September 1998

First version of this true Perl module.