=head1 NAME

Devel::Assert - assertions for Perl >= 5.14


    use Devel::Assert; # release mode, won't perform checks

    assert(3 < 2); 

    use Devel::Assert 'on';

    assert(3 < 2); # oops, check your math

=head1 USAGE

    use Devel::Assert; # import 'assert' function, but doesn't enable it
    use Devel::Assert 'on'; # import 'assert' function and enable it

    use Devel::Assert 'global'; # import 'assert' function and enable it in all later 'use Devel::Assert' imports
    use Devel::Assert::Global; # the same, can be used as perl -MDevel::Assert::Global your_program.pl

    use Devel::Assert 'off'; # import 'assert' function, but doesn't enable it, even when in 'global' mode


This module provides you with a C-like assert() function. And, like in C, it only is compiled in
debug mode - it's completely removed together with it's arguments at compile time in release mode.
That's useful to force functions' contracts during development without sacrificing production performance. 

Think of an assert() being a test, but right inside your code:

    sub get_url {
        my ($self, $url, $cb) = @_;

        assert length $url;
        assert(ref($cb) eq 'CODE');


Failed assertions are reported by L<confess> with failed test code embedded:

    Assertion 'ref $cb eq 'CODE'' failed at ...

This module doesn't use source filters or any other form of source text parsing, but instead
relies on the generated optree analysis and manipulation.

=head1 CHANGES FROM 0.04

This version significantly differs from 0.04 release. The main reason behind such radical change was
to get rid of the L<Devel::Declare> dependency and to pass all the parsing work to Perl itself (instead
of creating own statement parser).

=head1 SEE ALSO

L<assertions> - uses code attributes

L<Carp::Assert> - requires annoying 'if DEBUG' suffix

L<PerlX::Assert> - based on L<Devel::Declare>

=head1 AUTHOR

Sergey Aleynikov <randir@cpan.org>


Copyright (C) 2009, 2015 Sergey Aleynikov

=head1 LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.