A couple of options:
use Internals qw(SetReadOnly);; $fred = bless {},'fred';; @$fred{ qw[ jack john bill ] } = ();; SetReadOnly $fred;; print Dumper $fred;; $VAR1 = bless( { 'john' => undef, 'jack' => undef, 'bill' => undef }, 'fred' ); $fred->{bill} = 3;; print Dumper $fred;; $VAR1 = bless( { 'john' => undef, 'jack' => undef, 'bill' => 3 }, 'fred' ); $fred->{derf} = 'error';; Attempt to access disallowed key 'derf' in a restricted hash at (eval +11) line 1, <STDIN> line 9. print Dumper $fred;; $VAR1 = bless( { 'john' => undef, 'jack' => undef, 'bill' => 3 }, 'fred' );
In reply to Re: Should I use Fields, InsideOuts, or Properties?
by BrowserUk
in thread Should I use Fields, InsideOuts, or Properties?
by tphyahoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |