NAME

Syntax::Keyword::Assert - assert keyword for Perl

SYNOPSIS

use Syntax::Keyword::Assert;

sub hello($name) {
    assert { defined $name };
    say "Hello, $name!";
}

hello("Alice"); # => Hello, Alice!
hello();        # => Dies when STRICT mode is enabled

DESCRIPTION

This module provides a syntax plugin that introduces an assert keyword to Perl. It dies when the block returns false and STRICT mode is enabled. When STRICT mode is disabled, the block is ignored at compile time. The syntax is simple, assert BLOCK.

STRICT mode is controlled by Devel::StrictMode.

SEE ALSO

PerlX::Assert, Devel::Assert, Carp::Assert

LICENSE

Copyright (C) kobaken.

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

AUTHOR

kobaken <kentafly88@gmail.com>