Abigail is correct.
Essentially you have to remember that any action which results in 'undef' will fail the entire rule. The action in var_value seems to be setting $return to 'undef', which fails the IF rule, which is why it is thought to be a label.
(sticking a '1;' after the '$result = line', corrects the result, but not the actual problem, which will only parse correct code (ie wenn the variable has been created before it gets to the IF statement)
C.