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