04 Oct 2004 19:30:54 UTC
- Distribution: DBIx-Recordset
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (4)
- Testers (14 / 118 / 0)
- KwaliteeBus factor: 1
- 3.92% Coverage
- License: unknown
- Activity24 month
- Download (92.54KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionGRICHTER Gerald Richter
DBIx::Recordset::FileSeq - Sequence generator in Filesystem
use DBIx::Recordset::FileSeq ; $self = DBIx::Recordset::FileSeq (undef, '/tmp/seq', $min, $max) ; $val1 = $self -> NextVal ('foo') ; $val2 = $self -> NextVal ('foo') ; $val3 = $self -> NextVal ('bar') ;
DBIx::Recordset::FileSeq generates unique numbers. State is kept in the filesystem. With the new constructor you sepcify the directory where the state is kept. (First parameter is a dummy values, that will receive the database handle from DBIx::Recordset, but you don't need it when you use it without DBIx::Recordset). Optionaly you can give a min and a max values, which will be used for new sequences.
With NextVal you can get the next value for the sequence of the given name.
The state if kept by haveing a file with the name
Each time the sequnce value increments the file is renamed. If the <max> if a numeric value the new value is checked against <max> and NextVal dies if the sequnce value increment above max.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 194:
'=item' outside of any '=over'
=over without closing =back
Module Install Instructions
To install DBIx::Recordset, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install DBIx::Recordset
For more information on module installation, please visit the detailed CPAN module installation guide.