/[mdap]/lib/MDAP.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /lib/MDAP.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 58 - (hide annotations)
Fri Nov 16 19:12:08 2007 UTC (16 years, 5 months ago) by dpavlin
File size: 568 byte(s)
 r78@brr:  dpavlin | 2007-11-16 20:12:03 +0100
 cleanup messages and plugins

1 dpavlin 49 package MDAP;
2 dpavlin 58 use Exporter 'import';
3     our @EXPORT = qw/
4     once
5     dump
6     /;
7 dpavlin 49
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 dpavlin 58 =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 dpavlin 49 1;

  ViewVC Help
Powered by ViewVC 1.1.26