/[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 64 - (hide annotations)
Sun Nov 18 00:55:43 2007 UTC (16 years, 5 months ago) by dpavlin
File size: 592 byte(s)
 r89@brr:  root | 2007-11-18 01:51:20 +0100
 - move $debug into MDAP and export it
 - iterate plugins correctly

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

  ViewVC Help
Powered by ViewVC 1.1.26