Are you sure that you pass the recurselabel by reference (prototypes in perl guarantee next to nothing)? Perl would most likely not enjoy incrementing its internal references. Perhaps this is the problem? All we can do is really guess since it is unclear which value is actually passed. Be sure that you are using strict and the other diagnostic tools- perhaps even fire up that dusty perl debugger...