The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
use strict;
use warnings;
use Test::More;

{
    package Foo;

    use Moose;

    use overload '""' => sub {''};

    sub bug { 'plenty' }

    __PACKAGE__->meta->make_immutable;
}

ok(Foo->new()->bug(), 'call constructor on object reference with overloading');

done_testing;