Subject: | Problem with clone method when Clone module is not available |
The inline clone implementation is flawed in that it calls $self->new, which will result in `bless {}, shift`.
This is a problem because calling bless with the CSS::Tiny object as the classname is an error (reference, vs name).
Instead, one of the following should be done:
1) In clone: my $copy = new(ref $self)
2) In clone: my $copy = (ref $self)->new
3) In clone: my $copy = bless {},ref($self);
4) sub new {
my $class = shift;
$class = ref($class) if ref($class);
bless {}, $class
}