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 reply to Re: End of subroutine
by mpeever
in thread End of subroutine
by sandy_1028
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |