ormy $e = Example::Module->new(@list);
Both are supported by the snippet code! Even works if ->new is inherited, and doesn't disturb any other class methods.my $e = Example::Module(@list);
package Example::Module; ... sub Example::Module { return "Example::Module" unless @_; Example::Module::->new(@_); # extra colons are necessary } ...
In reply to Create a constructor named the same as your package name! by merlyn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |