in reply to Flipper

You can use Tie::FlipFlop for the same purpose. Here's the synopsis from the perldoc document:
use Tie::FlipFlop; tie my $flipflop => Tie::FlipFlop => qw /Red Green/; print $flipflop; # Prints 'Red'. print $flipflop; # Prints 'Green'. print $flipflop; # Prints 'Red'.
It's probably too much for such a simple function but frees you from keeping the $flip variable around.

You can use Tie::Counter in the same fashion to rotate through more than two elements.