sub LIMIT { 4 }
What is the point in defining LIMIT when you don't use it? :) Oh, and adding an empty prototype makes your LIMIT inlineable, which will increase speed (okay, in scripts like these you'll hardly notice the difference, but hey, it's only two extra characters (or three if you want whitespace, like I do)).
sub LIMIT () { 4 }
No, this is not a bad use of prototypes. Actually, this is a very good feature which allows for constants to be used (the
constant pragma does the same)
use constant LIMIT => 4;
I don't like that syntax, though, so I stick to subs with empty prototypes.
Yes, I reinvent wheels.