Keep It Simple, Stupid | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
perldoc UNIVERSAL will help; for example, you missed VERSION.
I realize samtregar mentioned BEGIN, CHECK, INIT, and END as not being subroutines. That is, in fact, not the case. They are all special subroutines, and attempting to define one by that name will cause it to trigger as if you had left out the "sub" keyword. So, you were on the right track with them.
The print statement is run even if BEGIN is not called. You can't even call BEGIN yourself after that. Personally I'd avoid any subroutine name in all caps. For example, you missed all of the tie hooks (see perltie). I have seen modules (Class::InsideOut springs to mind) that will call all-caps subroutines in your modules, but it's chancy; the subroutine name may get hijacked by Perl at some point. In reply to Re: Which are perl-internal subroutines?
by Somni
|
|