in reply to Re^4: The purpose of prototypes in perl subroutines
in thread The purpose of prototypes in perl subroutines
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
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^6: The purpose of prototypes in perl subroutines
by brian_d_foy (Abbot) on Apr 13, 2005 at 18:12 UTC |
In Section
Seekers of Perl Wisdom