Re: RFC: DBIx::Counter - persistent counter class with dbi storage

Stephen Howard <howars-pIzyFAQJLTv2fBVCVOL8/[email protected]> Thu, 14 Apr 2005 15:58:21 -0400
Newsgroups gmane.comp.lang.perl.code-review-ladder
Message-ID <[email protected]>
SYNOPSIS

>>        use DBIx::Counter;
>>        $c = new DBIx::Counter('my counter',
>>                                dsn       => 'dbi:mysql:mydb',
>>                                login     => 'username',
>>                                password  => 'secret'
>>                              );
>>    
>>
You might also consider an alertnate constructor that took an already 
instantiated db handle:

$c = new DBIx::Counter( 'my counter', dbh => $dbh );

chances are if someone is interested in storing their counter in the 
database, they're using that db for other things as well and may already 
have a db handle lying around.