Sorry. I should have demonstrated that also.
use Internals qw[SetReadOnly];; @a = 1 .. 3;; SetReadOnly \@a;; print @a;; 1 2 3 $a[ 2] = 'changed';; print @a;; 1 2 changed push @a, 'added';; Modification of a read-only value attempted at SetReadOnly \$a[1];; $a[1] = 'changed';; Modification of a read-only value attempted at
In reply to Re^3: Is there a way to lock arrays?
by BrowserUk
in thread Is there a way to lock arrays?
by tphyahoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |