##
use Readonly;
Readonly my $fortytwo => 42; # note: =>, not =
...
if ($fortytwo=$answer) { # "Modification of a read-only value attempted"
...
}
##
##
use constant FORTYTWO => 42; # note: =>, not =
...
if (FORTYTWO=$answer) { # "Can't modify constant item in scalar assignment"
...
}