if ($answer=42) { # $answer is now always 42 ... } if (42=$answer) { # "Can't modify constant item in scalar assignment" ... } #### 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" ... }