#! perl -slw use strict; use Internals qw[ SetReadOnly ]; use constant BAR => { x => 1 }; SetReadOnly( BAR ); BAR->{y} = 12345; ## Modification of a read-only value attempted ... use constant BAZ => [ 1, 2, 3, 4, 5, ]; SetReadOnly( BAZ ); push @{ +BAZ }, 1; # Modification of a read-only value attempted ... ## Unfortunately, these do not produce errors? ++BAR->{x}; ++BAZ->[0]; __END__ C:\test>junk7 Modification of a read-only value attempted at C:\test\junk7.pl line 13.