Bit-FlipFlop
view release on metacpan or search on metacpan
FlipFlop.pm view on Meta::CPAN
To determine how many times a flip flop has been evaluated since being
in the true state, numerify its return value. This number includes the
evaluation that caused the flip flop to flip states to true. If the flip
flop is in the false state, then using this "method" will yield the
integer zero (0).
$r = set_test() ... reset_test();
# this same $r is present in the examples below
print 'the flip flop has been true for ', +$r, " iterations.\n";
=item lead_edge
The leading edge, when a flip flop changes from the false state to true
can be detected by testing the series for number 1.
print "leading edge\n" if $r == 1;
=item trail_edge
( run in 1.287 second using v1.01-cache-2.11-cpan-96521ef73a4 )