Upgrade to PathTools-3.23.
[p5sagit/p5-mst-13.2.git] / lib / assertions / activate.pm
index d019b77..ba1f5de 100644 (file)
@@ -1,13 +1,11 @@
 package assertions::activate;
 
-our $VERSION = '0.01';
-
-# use strict;
-# use warnings;
+our $VERSION = '0.02';
 
 sub import {
     shift;
-    push @{^ASSERTING}, ( map { qr/^$_$/ } @_) ;
+    @_ = '.*' unless @_;
+    push @{^ASSERTING}, map { ref $_ eq 'Regexp' ? $_ : qr/^(?:$_)\z/ } @_;
 }
 
 1;
@@ -15,36 +13,39 @@ __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<assertions::activate> 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.
 
+Though it can also be explicetly used:
 
-=head2 EXPORT
+  use assertions::activate qw(foo bar);
 
-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<assertions>
+L<assertions>, L<perlrun>.
 
 =head1 AUTHOR
 
-Salvador Fandiño, E<lt>sfandino@yahoo.comE<gt>
+Salvador FandiE<ntilde>o, E<lt>sfandino@yahoo.comE<gt>
 
 =head1 COPYRIGHT AND LICENSE
 
-Copyright 2002 by Salvador Fandiño
+Copyright 2002, 2005 by Salvador FandiE<ntilde>o
 
 This library is free software; you can redistribute it and/or modify
 it under the same terms as Perl itself.