- or download this
> i tried
> sub flip { $@_[0] = !($@_[0] };
- or download this
sub flip { ${ $_[0] } = !${ $_[0] } }
- or download this
use Tie::FlipFlop;
...
print $flipflop; # Prints 'Red'.
print $flipflop; # Prints 'Green'.
print $flipflop; # Prints 'Red'.