Skip to content

Instantly share code, notes, and snippets.

@EdwardIII
Created April 1, 2011 15:36
Show Gist options
  • Save EdwardIII/898350 to your computer and use it in GitHub Desktop.
Save EdwardIII/898350 to your computer and use it in GitHub Desktop.
sub next_manufacturer {
my $self = shift;
state $i = 0; #XXX: Breaks if used across multiple objects
my @manufacturers = @{$self->manufacturers};
return $manufacturers[$i++] || 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment