/[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 69 by dpavlin, Sun Nov 18 00:55:43 2007 UTC revision 70 by dpavlin, Sun Nov 18 10:28:28 2007 UTC
# Line 27  MDAP - common stuff Line 27  MDAP - common stuff
27    
28    once("this message will be reported just once");    once("this message will be reported just once");
29    
30    Returns true if this message was seen first time.
31    
32  =cut  =cut
33    
34  our $once;  our $once;
# Line 34  our $once; Line 36  our $once;
36  sub once {  sub once {
37          my $m = join('', @_);          my $m = join('', @_);
38          $once->{$m}++;          $once->{$m}++;
39          print "$m\n" if ($once->{$m} == 1);          if ($once->{$m} == 1) {
40                    print "$m\n";
41                    return 1;
42            }
43            return;
44  }  }
45    
46  sub DESTROY {  sub DESTROY {

Legend:
Removed from v.69  
changed lines
  Added in v.70

  ViewVC Help
Powered by ViewVC 1.1.26