more useful options | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Well, in Perl the constructor is called bless. Now,
it's popular to call a subroutine that is called as a class
method, and that returns a blessed reference a 'constructor',
but on the language level, it's just a subroutine that's called as a class method. Nothing special there.
And, as far as I know, it's not possible to leave a bless midway. From a language perspective, it's an atomic operation, with one op in the optree. Of course, in the given code fragment, neither bless, nor the subroutine returning the blessed reference is left halfway. Printing out a redirection header won't make your program exit (unless there are some bugs somewhere). Abigail In reply to Re: OO: Leaving a constructor midway?
by Abigail-II
|
|