Luke Palmer wrote: > Since variables are copy-on-write, you get the speed of > pass-by-reference with the mutability of pass-by-value, > which is what everyone wants. If you have this, why would > you want to do enforced const reference? That's not > rhetorical; I'm actually curious.
One reason I can think of would be if you had multiple threads, and you wanted to poll a pass-by-reference shared value inside the sub: sub wait_for_done ( $done is shared ) { return if $done; sleep 1; redo; } Dave.