Acme-Don-t

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN


        don't { print "This won't be printed\n" };    # NO-OP

DESCRIPTION
    The Acme::Don't module provides a `don't' command, which is the opposite
    of Perl's built-in `do'.

    It is used exactly like the `do BLOCK' function except that, instead of
    executing the block it controls, it...well...doesn't.

    Regardless of the contents of the block, `don't' returns `undef'.

AUTHOR
    Damian Conway (damian@conway.org)

COPYRIGHT
    Copyright (c) 2002, Damian Conway. All Rights Reserved. This module is
    free software. It may be used, redistributed and/or modified under the
    terms of the Perl Artistic License (see
    http://www.perl.com/perl/misc/Artistic.html)

t.pm  view on Meta::CPAN

    don't { print "This won't be printed\n" };    # NO-OP

=head1 DESCRIPTION

The Acme::Don't module provides a C<don't> command, which is the 
opposite of Perl's built-in C<do>.

It is used exactly like the C<do BLOCK> function except that,
instead of executing the block it controls, it...well...doesn't.

Regardless of the contents of the block, C<don't> returns C<undef>.

You can even write:

    don't {
        # code here
    } while condition();

And, yes, in strict analogy to the semantics of Perl's magical
C<do...while>, the C<don't...while> block is I<unconditionally>
not done once before the test. ;-)



( run in 3.161 seconds using v1.01-cache-2.11-cpan-d80b1682f3f )