File: Serial.pm

package info (click to toggle)
libpod-abstract-perl 0.20-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, trixie
  • size: 248 kB
  • sloc: perl: 2,006; makefile: 2
file content (50 lines) | stat: -rw-r--r-- 861 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package Pod::Abstract::Serial;
use strict;
our $VERSION = '0.20';

my $serial_number = 0;

=head1 NAME

Pod::Abstract::Serial - generate a global sequence of serial numbers.

=head1 DESCRIPTION

Used to number Pod::Abstract::Node elements for identification.

=head1 BUGS

This will cause problems with Pod::Abstract documents frozen to disk
using Data::Dumper etc, unless C<set> is used to bump the number above
the highest number read.

Or just serialise your document with C<< $node->pod >> instead!

=cut

sub next {
    return ++$serial_number;
}

sub last {
    return $serial_number;
}

sub set {
    $serial_number = shift;
}

=head1 AUTHOR

Ben Lilburne <bnej@mac.com>

=head1 COPYRIGHT AND LICENSE

Copyright (C) 2009 Ben Lilburne

This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut

1;