use strict; use warnings; my $g1; my $g2 :resticted ; #or some other attribute mechanism $g1 = 'boo'; $g2 = 'blah'; { $g1 = 'changed' ; #OK. Same behaviour as now $g2 = 'cant change'; #Can't do this, ideally throw an exception my $copy_of_g2 = $g2; #OK. I can still read $g2. } print "$g1\n" print "$g2\n" __END__ changed blah