/[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

Diff of /lib/MDAP.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 49 by dpavlin, Fri Nov 16 16:21:45 2007 UTC revision 58 by dpavlin, Fri Nov 16 19:12:08 2007 UTC
# Line 1  Line 1 
1  package MDAP;  package MDAP;
2    use Exporter 'import';
3    our @EXPORT = qw/
4    once
5    dump
6    /;
7    
8  use strict;  use strict;
9  use warnings;  use warnings;
# Line 9  use Module::Pluggable search_path => 'MD Line 14  use Module::Pluggable search_path => 'MD
14  my @plugins = __PACKAGE__->plugins;  my @plugins = __PACKAGE__->plugins;
15  warn "## found plugins: ",dump( @plugins );  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;  1;

Legend:
Removed from v.49  
changed lines
  Added in v.58

  ViewVC Help
Powered by ViewVC 1.1.26