in reply to read only variable

You can emulate that with closures, although you'll be working with a subroutine instead of a hash:
sub make_readonly { my %h = @_; sub { $h{$_[0]}; } } my $v = make_readonly(name => 'Scott', shoesize => '9.5'); print $v->('name'),"'s shoes are size ",$v->('shoesize'),"\n";