in reply to Re: array value generation for sections
in thread array value generation for sections

I am just wondering why you use return return. If I would be at home, with Perl installed on the computer, I would have tested. My guess is that is has something to do with references.
But I'm at school. No Perl here. So would you be so kind to explain?




"2b"||!"2b";$$_="the question"

Replies are listed 'Best First'.
Re^3: array value generation for sections
by muntfish (Chaplain) on Jul 08, 2004 at 11:27 UTC

    I think it is just a typo. It does compile OK with "return return" (which surprised me, actually) but it works just as well with just the one return.

    Update: If you consider that return EXPR is just an expression with the value EXPR, but with the added side effect of returning control to the caller of the sub, then it makes sense that you can put return as many times as you like. Including (in this case, since it's the last line of the sub) zero times.

    s^^unp(;75N=&9I<V@`ack(u,^;s|\(.+\`|"$`$'\"$&\"\)"|ee;/m.+h/&&print$&;