assertions::activate - activate assertions


assertions documentation Contained in the assertions distribution.

Index


Code Index:

NAME

Top

assertions::activate - activate assertions

SYNOPSIS

Top

  use assertions::activate 'Foo', 'bar', 'Foo::boz::.*';

  # activate all assertions
  use assertions::activate;

DESCRIPTION

Top

This module is used internally by perl (and its -A command-line switch) to enable and disable assertions.

Though it can also be explicetly used:

  use assertions::activate qw(foo bar);

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.

SEE ALSO

Top

assertions, perlrun.

AUTHOR

Top

Salvador Fandiño, <sfandino@yahoo.com>

COPYRIGHT AND LICENSE

Top


assertions documentation Contained in the assertions distribution.

package assertions::activate;

our $VERSION = '0.02';

sub import {
    shift;
    @_ = '.*' unless @_;
    push @{^ASSERTING}, map { ref $_ eq 'Regexp' ? $_ : qr/^(?:$_)\z/ } @_;
}

1;
__END__