in reply to Is there a "better" way to cycle an array?

Not that this is any more correct than any other suggestion, but in the past I've used something like:

my @stuff = ( "a", "b", "c", "d" ); { my @current_list; sub cycle { @current_list = @stuff unless @current_list; return pop ( @current_list ); } }