readonly#
readonly($var) - returns true if $var is read-only.
The true value is not 1. Exactly as in perl5, it is the raw internal flag word, so a read-only scalar yields a number such as 134283264. Test it for truth; never compare it against 1. Takes exactly one argument.
sub foo { readonly($_[0]) }
$ro = foo($bar); # false
$ro = foo(0); # true