$cycle_length being declared globally is not acceptable. I would declare $first and $second in the loop, but they're acceptable where they are.
The other issue it's very hard to spot the loop in your sub. May I recommend
for (;;) { # I read this as "for ever" ... }
or the more popular
while (1) { ... }
In reply to Re: General style advice requested
by ikegami
in thread General style advice requested
by iangibson
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |