in reply to Re^3: 'return:' instead of 'return'
in thread 'return:' instead of 'return'

And the last statement in a sub seems to be excluded from 'useless use of constant' warnings, I didn't know that.

However, the other reason I didn't see "Useless use of a constant in a void context" is that my colleagues code has a variable (not a constant) after the 'return:'.


- Boldra

Replies are listed 'Best First'.
Re^5: 'return:' instead of 'return'
by rovf (Priest) on Jun 12, 2009 at 13:15 UTC
    And the last statement in a sub seems to be excluded from 'useless use of constant' warnings, I didn't know that.

    It's not exclude. The reason why you don't see this warning, is because a constant as the last statement in a sub is not useless at all.

    -- 
    Ronald Fischer <ynnor@mm.st>
Re^5: 'return:' instead of 'return'
by bart (Canon) on Jun 12, 2009 at 11:50 UTC
    However, the other reason I didn't see "Useless use of a constant in a void context" is that my colleagues code has a variable (not a constant) after the 'return:'.
    So you would have seen a "Useless use of a variable in void context" warning instead.