In the generated constructor it was parsed and invoked as an indirect
method, which worked for classes that did not remove C<blessed> or
define it as an accessor.
This broke Search::GIN which had a class that used namespace::clean and
had a 'blessed' attribute which was incorrectly invoked on the class.
$source .= "\n" . 'my $_instance = shift;';
$source .= "\n" . q{Carp::cluck 'Calling new() on an instance is deprecated,'
- . ' please use (blessed $obj)->new' if blessed $_instance;};
+ . ' please use (blessed $obj)->new' if Scalar::Util::blessed($_instance);};
$source .= "\n" . 'my $class = Scalar::Util::blessed($_instance) || $_instance;';