Consider:
has ua_class => (
is => 'ro',
isa => t('ClassName'),
default => 'HTTP::Tiny',
);
has ua => (
is => 'ro',
isa => t('Object'),
default => sub { shift->ua_class->new() },
);
If somebody sets ua_class to an object overloading stringification, and the stringification yields a valid classname, then what will ua be?
This seems a source for very hard to diagnose bugs, especially as things like warn $self->ua_class will hide the issue.
Consider:
If somebody sets
ua_classto an object overloading stringification, and the stringification yields a valid classname, then what willuabe?This seems a source for very hard to diagnose bugs, especially as things like
warn $self->ua_classwill hide the issue.