X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fassertions%2Factivate.pm;h=198b8368a67079dde395ebfa65fd00d22d1446ac;hb=8468119f6ee8085392e5c77b735fdba19cf0f08e;hp=6f0f37ec03a2a693e0443d5985a7a72fb6e18257;hpb=c54bef43fcdd063d25ceba778d8312dbe8d69abd;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/assertions/activate.pm b/lib/assertions/activate.pm index 6f0f37e..198b836 100644 --- a/lib/assertions/activate.pm +++ b/lib/assertions/activate.pm @@ -2,12 +2,10 @@ package assertions::activate; our $VERSION = '0.01'; -# use strict; -# use warnings; - sub import { shift; - push @{^ASSERTING}, ( map { qr/^$_$/ } @_) ; + @_ = '.*' unless @_; + push @{^ASSERTING}, map { qr/^(?:$_)\z/ } @_; } 1; @@ -15,28 +13,27 @@ __END__ =head1 NAME -assertions::activate - assertions activation +assertions::activate - activate assertions =head1 SYNOPSIS - use assertions::activate 'Foo', 'bar', 'Foo::boz::.*' ; - -=head1 ABSTRACT + use assertions::activate 'Foo', 'bar', 'Foo::boz::.*'; -C module is used to configure assertion -execution. + # activate all assertions + use assertions::activate; =head1 DESCRIPTION +This module is used internally by perl (and its C<-A> command-line switch) to +enable and disable assertions. It can also be used directly. - -=head2 EXPORT - -None by default. +The import parameters are a list of strings or of regular expressions. The +assertion tags that match those regexps are enabled. If no parameter is +given, all assertions are activated. =head1 SEE ALSO -L +L, L. =head1 AUTHOR