Problem #1: You have an "or" statement, not a subroutine block therefore a return(-1) is nonsense...return -1 to where and to whom?
No, there's no reason to believe there's a problem with return. The snippet comes from a sub, that's all.
What I find odd is returning a true value on error. But it's not unheard of in specific circumstances (e.g. getc, index).
In reply to Re^2: How do I use a block as an ‘or’ clause instead of a simple die?
by ikegami
in thread How do I use a block as an ‘or’ clause instead of a simple die?
by boom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |