Parent Directory | Revision Log
r78@brr: dpavlin | 2007-11-16 20:12:03 +0100 cleanup messages and plugins
1 | package MDAP; |
2 | use Exporter 'import'; |
3 | our @EXPORT = qw/ |
4 | once |
5 | dump |
6 | /; |
7 | |
8 | use strict; |
9 | use warnings; |
10 | |
11 | use Data::Dump qw/dump/; |
12 | |
13 | use Module::Pluggable search_path => 'MDAP', sub_name => 'plugins', require => 1; |
14 | my @plugins = __PACKAGE__->plugins; |
15 | warn "## found plugins: ",dump( @plugins ); |
16 | |
17 | =head1 NAME |
18 | |
19 | MDAP - common stuff |
20 | |
21 | =head1 FUNCTIONS |
22 | |
23 | =head2 once |
24 | |
25 | once("this message will be reported just once"); |
26 | |
27 | =cut |
28 | |
29 | our $once; |
30 | |
31 | sub once { |
32 | my $m = join('', @_); |
33 | $once->{$m}++; |
34 | print "$m\n" if ($once->{$m} == 1); |
35 | } |
36 | |
37 | sub DESTROY { |
38 | warn "all messages: ",dump( $once ); |
39 | } |
40 | |
41 | 1; |
ViewVC Help | |
Powered by ViewVC 1.1.26 |