Dave Mitchell <davem@iabyn.com> wrote: :=head2 :ro [...] :then within the lexical scope of $x (from the point it's been introduced :onwards), any lvalue-context usage of that variable is a compile-time :error. Note that as well as forbidding all the obvious stuff like $x++, :all the following would also be compile-time errors: : : foo($x); : for ($x, ...) { ...} : $y = \$x; : sub foo: lvalue { ....; return $x } I can imagine that being inconvenient. Is there an easy way to get an unmodified temp copy of the value (for uses such as foo($x) or for (...)) without needing another variable? Modified temp copies are easy to get with eg "$x" or 0+$x, but I don't offhand know of an easy way to get an unmodified copy. If we can make it convenient enough, I can see a lot of value in using this to write more obviously functional code. HugoThread Previous | Thread Next