2 use warnings FATAL => 'all';
9 sub as_string { "welp" }
22 sub new { bless {}, shift }
27 use overload fallback => 0;
30 sub new { bless {}, shift }
34 is "$o", 'welp', 'subref overload';
35 is 0+$o, 219, 'method name overload';
36 ok !!$o, 'anon subref overload';
38 my $o2 = MyClass2->new;
39 eval { my $f = 0+$o2 };
40 like $@, qr/no method found/, 'fallback value not overwritten';