|
Perl 6
Pugs Diagnostics: Revision 4
This page is for documenting diagnostic messages emitted by Pugs, along with hints about what causes them and how to address them. Can't modify constant item
Sometimes variables are read-only, such as when they are declared in a subroutine signature
sub foo ($a) {
$a ~~ s/b/c/; # Boom!
}
foo('b');
You can make a read/write copy of the variable through assignent ($b = $a), or by using is copy to declare that you want a read/write copy of the variable, or is rw to declare you want the variable being passed in to be modified by reference. |