This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make tr/a/b/ croak on read-only null COWs
$ ./perl -Ilib -e 'use constant nullrocow => (keys%{{""=>undef}})[0]; for(nullrocow) { y/a/b/ }'
$ ./perl -Ilib -e 'use constant nullro => ""; for(nullro) { y/a/b/ }'
Modification of a read-only value attempted at -e line 1.
It should croak on COW scalars that are read-only, even if they are
zero-length, just as it does on non-COW scalars.
This logic is left over from when READONLY+FAKE meant COW.