But if you accept that terminology, all subroutine declarations are prototyping, and in a sense they are, but since perl's prototyping is rather different from other language's, I think that would only confuse people even more.
FWIW, I think that the whole term is an unfortunate choice in perl.
| [reply] |
Just because someone says something doesn't make it true. This isn't just semantics, either.
Perhaps you give us the reference where you found Nat talking about this sort of prototype (article name or page number would work). IF you are talking about the "Cryptocontext" article, I think you've misunderstood something.
--
brian d foy <brian@stonehenge.com>
| [reply] |
Okay, Page 20, "Computer Science & Perl Programming", edited by Jon Orwant, Chapter 3, article title is Perfect Programming.
I'm not making this up:
Quote: When it's in effect, you can't use the bareword style of calling subroutines with no arguments (e.g. $result = mysub;) unless the subroutine was declared before its use, either with a prototype or with the subroutine definition itself.
EndQuote:
use strict 'subs';
print count; # an error with use strict 'subs'
sub count; # prototyping count() is sufficient
print count; # Not an error because Perl now knows about count()
J. J. Horner
CISSP,CCNA,CHSS,CHP,blah,blah,blah
| [reply] [d/l] |
The part that you called "prototyping" before is just the subroutine's forward definition. He gives two things there that get around 'use strict', and the one you used wasn't the one with prototypes.
The very first example in perlsub tells you which one you used:
To declare subroutines:
sub NAME; # A "forward" declaration.
sub NAME(PROTO); # ditto, but with prototypes
--
brian d foy <brian@stonehenge.com>
| [reply] [d/l] |