--- lib/MDAP.pm 2007/11/16 18:18:31 57 +++ lib/MDAP.pm 2007/11/16 19:12:08 58 @@ -1,4 +1,9 @@ package MDAP; +use Exporter 'import'; +our @EXPORT = qw/ +once +dump +/; use strict; use warnings; @@ -9,4 +14,28 @@ my @plugins = __PACKAGE__->plugins; warn "## found plugins: ",dump( @plugins ); +=head1 NAME + +MDAP - common stuff + +=head1 FUNCTIONS + +=head2 once + + once("this message will be reported just once"); + +=cut + +our $once; + +sub once { + my $m = join('', @_); + $once->{$m}++; + print "$m\n" if ($once->{$m} == 1); +} + +sub DESTROY { + warn "all messages: ",dump( $once ); +} + 1;