Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Perl Modules

    DBIx::Counter 0.03

    Download button

    No screenshots available
    Downloads: 340  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Rhesa Rozendaal | More programs
    Perl Artistic License / FREE
    February 17th, 2009, 18:25 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    DBIx::Counter description

    Manipulate named counters stored in a database

    DBIx::Counter is a Perl module to manipulate named counters stored in a database.

    WARNING

    This is the initial release! It has been tested to work with SQLite, Mysql, Postgresql and MS SQL Server, under perl 5.6 and 5.8.

    I would appreciate feedback, and some help on making it compatible with older versions of perl. I know 'use warnings' and 'our' don't work before 5.6, but that's where my historic knowledge ends.

    SYNOPSIS

     use DBIx::Counter;
     $c = DBIx::Counter->new('my counter',
     dsn => 'dbi:mysql:mydb',
     login => 'username',
     password => 'secret'
     );
     $c->inc;
     print $c->value;
     $c->dec;


    This module creates and maintains named counters in a database. It has a simple interface, with methods to increment and decrement the counter by one, and a method for retrieving the value. It supports operator overloading for increment (++), decrement (--) and stringification ("").

    It should perform well in persistent environments, since it uses the connect_cached and prepare_cached methods of DBI.

    The biggest advantage over its main inspiration - File::CounterFile - is that it allows distributed, concurrent access to the counters and isn't tied to a single file system.

    Connection settings can be set in the constructor. The table name is configurable, but the column names are currently hard-coded to counter_id and value.

    The following SQL statement can be used to create the table:

     CREATE TABLE counters (
     counter_id varchar(64) primary key,
     value int not null default 0
     );


    This module attempts to mimick the File::CounterFile interface, except currently it only supports integer counters. The locking functions in File::CounterFile are present for compatibility only: they always return 0.


    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    named counters | DBIx counter | Perl module | DBIx | counter | database

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM