I’ve googled the error (stated in the Question title) and can’t find anything relevant.
#!/usr/bin/perl
use strict;
my %cc;
my @cc => (3,4,5,6,6,7,7);
$cc{key} = \@cc;
$0 = $cc{key}[0] * 2;
$1 = $cc{key}[1] * 1; #error here
my $total = $0 + $1;
print "$1";
print "$total";
line 11 is my error…
$0and$1are special variables in Perl (see perldoc perlvar).$1is a read only variable.Also, you should enable warnings to see many more problems with your code.
My guess is that you want something like this:
perldoc perldiag has more information on the error message: “Modification of a read-only value attempted”.