in reply to References, Prototypes, and read-only values

Do you have "use strict;" at the top of this script? I can reproduce your error. But when strict is added I get a warning about a reference in the line with the increment. You probably have a numerical value in $rs_RecurseLabel, which is not valid in a reference such as $$rs_RecurseLabel.

Addendum: As I play with this further, I see tye is correct. Something is goofy with the prototyping. You must declare prototyped subs before the code that calls them. When I put the calling code after the prototyped sub, the prototype automatically creates a reference to your variable and the read-only error goes away. When the sub is after the call, I can get your same error. Also, it is not idiomatic to modify parameters in place like this, especially with nothing in the function call to specify that the third parameter will be treated as a reference. You may want to explore a different approach, such as changing the value via a return value.
  • Comment on (ichimunki) re: References, Prototypes, and read-only values