brian d foy

NAME

Tie::Toggle - False and true, alternately, ad infinitum.

SYNOPSIS

    use Tie::Toggle;

    tie my $toggle, 'Tie::Toggle';

        foreach my $number ( 0 .. 10 ) {
                next unless $toggle;

                print $number, "\n";
                }

DESCRIPTION

You use Tie::Toggle to go back and forth between false and true over and over again. You don't have to worry about any of this since the magic of tie does that for you by using Tie::Cycle. Any time you access the value, it flips.

You can also use Tie::FlipFlop by Abigail to do the same thing, but with any two values.

SOURCE AVAILABILITY

This source is in GitHub:

        https://github.com/briandfoy/Tie-Toggle

AUTHOR

brian d foy, <bdfoy@cpan.org>.

COPYRIGHT AND LICENSE

Copyright © 2000-2016, brian d foy <bdfoy@cpan.org>. All rights reserved.

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