Ahh! OK. The first one was what I was trying, and it just kept saying invalid integer "current_val", as you'd expect.
I think my attempts to do the second one failed because of a bug elsewhere in the subroutines block, but the error always seemed to gravitate to the "}" at the end of the block... Thanks again! I've removed my shonky iterative setter. :)
Perhaps a concrete example of setting a variable equal to another variable in the documentation might help new users?