develooper Front page | perl.perl5.porters | Postings from June 2010

Re: [perl #75662] Panic error while using goto with "given when"statement

Thread Previous
From:
Dave Mitchell
Date:
June 11, 2010 06:52
Subject:
Re: [perl #75662] Panic error while using goto with "given when"statement
Message ID:
20100611135204.GE2988@iabyn.com
On Thu, Jun 10, 2010 at 02:03:22PM -0700, PRAKHER SINGHAL wrote:
> I got "Panic: goto" error while using goto inside "given when statement".
> My code is here:
> 
> 
> use feature "switch";
> use ExtUtils::MakeMaker qw(prompt);
> 
> start: $input = prompt("Enter Input:");
> 
> given($input){
> 
>     when (/^cat/) { print "Cat"; }
>     when (/^rat/) { print "Rat"; }
>     default { goto start;}
> 
>     }

Thanks for the report. This has already been fixed in perl 5.12.0, by
commit bb5aedc13f30a9f0a65cc4c489b97a919d5d03a2.


-- 
A walk of a thousand miles begins with a single step...
then continues for another 1,999,999 or so.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About