in reply to subroutine prototypes effectiveness across files?

Just as chromatic prognosticated...

Don't use prototypes. At least, don't use them without being aware of their limitations and the fact that they are poorly named. Prototypes aren't prototypes like you find in other languages. They are good for three things:

  1. Hinting that a sub might be inlinable (with an empty prototype.)
  2. Emulating builtin behavior.
  3. Extending the language syntax.

While prototypes may be good for tasks two and three above, doing either of them usually isn't a good idea in the first place.¹ Hence, prototypes have very limited use.

I urge everyone to read and understand Tom Christiansen's article on prototypes before using them.

1. There are exceptions of course, but that's what they are. . . exceptions.

-sauoq
"My two cents aren't worth a dime.";
  • Comment on Re: subroutine prototypes effectiveness across files?