Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created July 29, 2016 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/efa0438a67893ce4293bc2bc969b2611 to your computer and use it in GitHub Desktop.
Save zoffixznet/efa0438a67893ce4293bc2bc969b2611 to your computer and use it in GitHub Desktop.
my @nicks = <n1 n2 n3>;
my $current-nick = @nicks[0];
loop {
say "Current nick is $current-nick";
my $idx = 0;
for @nicks.kv -> $i, $n {
next unless $n eq $current-nick;
$idx = $i + 1;
$idx = 0 if $idx == @nicks;
};
sleep 3 if $idx == 0;
$current-nick = @nicks[$idx];
last if $++ > 7;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment