##
sub flip { ${ $_[0] } = !${ $_[0] } }
####
use Tie::FlipFlop;
tie my $flipflop => Tie::FlipFlop => qw /Red Green/;
print $flipflop; # Prints 'Red'.
print $flipflop; # Prints 'Green'.
print $flipflop; # Prints 'Red'.