You can declare it, yes, but it's not read only. The reference itself remains constant, but the data that it's referring to can be changed:
use constant HASH_REF => { key => 'value' }; HASH_REF->{new_key} = 'new value'; HASH_REF->{key} = 'modified'; use Data::Dumper; print Dumper HASH_REF;
In reply to Re^5: Using Constants in Perl
by jhourcle
in thread Using Constants in Perl
by qazwart
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |