in reply to Re: Breaking output lines into N-element chunks
in thread Breaking output lines into N-element chunks
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)).
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)sub LIMIT () { 4 }
I don't like that syntax, though, so I stick to subs with empty prototypes.use constant LIMIT => 4;
Yes, I reinvent wheels.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Breaking output lines into N-element chunks
by particle (Vicar) on Apr 11, 2002 at 23:08 UTC | |
Re: Re: Re: Breaking output lines into N-element chunks
by demerphq (Chancellor) on Apr 12, 2002 at 13:43 UTC | |
by Juerd (Abbot) on Apr 12, 2002 at 14:50 UTC | |
by demerphq (Chancellor) on Apr 12, 2002 at 15:05 UTC | |
by Juerd (Abbot) on Apr 12, 2002 at 16:46 UTC | |
by particle (Vicar) on Apr 12, 2002 at 14:01 UTC | |
by demerphq (Chancellor) on Apr 12, 2002 at 14:15 UTC |