}
{
- # Check readonliness of constants (brought up in bug #109744)
- # For historical reasons, shared hash key scalars are exempt
+ # Check readonliness of constants, whether shared hash key
+ # scalars or no (brought up in bug #109744)
BEGIN { overload::constant integer => sub { "main" }; }
eval { ${\5} = 'whatever' };
like $@, qr/^Modification of a read-only value attempted at /,
'constant overloading makes read-only constants';
BEGIN { overload::constant integer => sub { __PACKAGE__ }; }
eval { ${\5} = 'whatever' };
- is $@, "", 'except with shared hash key scalars';
+ like $@, qr/^Modification of a read-only value attempted at /,
+ '... even with shared hash key scalars';
}
{
}
package NCmp;
- use base 'CmpBase';
+ use parent '-norequire', 'CmpBase';
use overload '<=>' => 'cmp';
package SCmp;
- use base 'CmpBase';
+ use parent '-norequire', 'CmpBase';
use overload 'cmp' => 'cmp';
package main;
? $nomethod . "=>'nomethod'," : '';
eval qq{
package NuMB$fall$nomethod;
- use base qw/NuMB/;
+ use parent '-norequire', qw/NuMB/;
use overload $nomethod_decl
fallback => $fall;
};