in reply to My first attempt to design a module
You have the snippet
sub new { my $class = shift; my %args = @_;
which I do a bit differently.
sub new { my ($class,%args) = @_; my $package = ref($class) || $class || confess "classless construct +or";
because I like to allow for
$something->new(...)where $something can be a string (class name) or an existing object. The existing object bit is especially handy when creating a clone.
- doug
|
|---|