my $class = ref $proto || $proto; ... bless $self, $class;
Don't do that. It generates a function/method that implies both constructor and clone semantics. new should be a class function that generates a new initialised object. An explicit copy or clone method (not class function) should be used to generate a cloned instance of an existing object. new() function: incorrect? and its replies discuss the topic at some length.
In reply to Re^2: A Class inside a Perl script?
by GrandFather
in thread A Class inside a Perl script?
by harsha.reddy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |