Skip Menu |

This queue is for tickets about the Sub-Frequency CPAN distribution.

Report information
The Basics
Id: 68843
Status: resolved
Priority: 0/
Queue: Sub-Frequency

People
Owner: Nobody in particular
Requestors: BLABOS [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.02
Fixed in: (no value)



Hi, When using a return statement into a code ref it will return from this code ref and not from the subroutine around it. This function foo: sub foo { usually { return 1} return 2; } Will return always 2, because the first return will return from within the usually block, never from the foo subroutine. Then, return 2 will always executed.
Thanks! I've documented the issue under the "CAVEATS" section of version 0.05, which should reach CPAN any moment now. Demorou mas saiu :) On Thu Jun 16 00:05:19 2011, BLABOS wrote: Show quoted text
> Hi, > > When using a return statement into a code ref it will return from this > code ref and not from the > subroutine around it. > > This function foo: > > sub foo { > usually { return 1} > return 2; > } > > Will return always 2, because the first return will return from within > the usually block, never from > the foo subroutine. Then, return 2 will always executed.