The stupid question is the question not asked | |
PerlMonks |
Re: End of subroutineby mpeever (Friar) |
on Nov 07, 2008 at 05:15 UTC ( [id://722155]=note: print w/replies, xml ) | Need Help?? |
The 1 isn't at the end of the subroutine: the subroutine ends with the '}'. The '1' typically marks the end of a module, as modules need to "return" a true value. From the Simple Module Tutorial: We need the 1; at the end because when a module loads Perl checks to see that the module returns a true value to ensure it loaded OK. You could put any true value at the end (see Code::Police) but 1 is the convention.
In Section
Seekers of Perl Wisdom
|
|