I saw code as below by someone. Though no error reported, I'm curious whether it's right:
sub new { my $this = {}; bless $this; return $this; }
Generally we return bless {},package. It's true that an object of Perl is indeed a data structure saying a hash. Does Perl create an new area for the object returned by bless? Does this new sub correct acctually?
In reply to Does this ctor make sense? by anaconda_wly
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |