Read-only aliases are a great way to save memory and if you accidentally try to modify the variable Perl will spit at you.
Read-write aliases have far more limited use cases, either you can't be arsed to pass in a reference or you're doing something magical. If you accidentally use a read-write alias Perl won't tell you.
Read-write is the default for aliased variables. Whoops.
is alias should imply is ro, same way is copy implies is rw. If the user wants a modifiable alias they should have to explicitly declare it so, or consider using a copy or pass by reference.
This would break backwards compatibility, but I wonder how much code it would actually break, and how many accidental modifications of aliases it would reveal.
Read-only aliases are a great way to save memory and if you accidentally try to modify the variable Perl will spit at you.
Read-write aliases have far more limited use cases, either you can't be arsed to pass in a reference or you're doing something magical. If you accidentally use a read-write alias Perl won't tell you.
Read-write is the default for aliased variables. Whoops.
is aliasshould implyis ro, same wayis copyimpliesis rw. If the user wants a modifiable alias they should have to explicitly declare it so, or consider using a copy or pass by reference.This would break backwards compatibility, but I wonder how much code it would actually break, and how many accidental modifications of aliases it would reveal.