Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Perl: porters

unexpected: Can't "goto" out of a pseudo block

 

 

Perl porters RSS feed   Index | Next | Previous | View Threaded


davem at iabyn

May 4, 2012, 8:02 AM

Post #1 of 3 (65 views)
Permalink
unexpected: Can't "goto" out of a pseudo block

$ perl5159 -e'@a = sort { goto FOO; FOO: $a <=> $b } 1,2,3'
Can't "goto" out of a pseudo block at -e line 1.
$

I'd expect this this code to execute ok. Can anyone think of a reason why
it isn't a bug?

(Discovered while adding tests for /(?{ ... do strange things ... })/ ).


--
Monto Blanco... scorchio!


nick at ccl4

May 4, 2012, 8:10 AM

Post #2 of 3 (65 views)
Permalink
Re: unexpected: Can't "goto" out of a pseudo block [In reply to]

On Fri, May 04, 2012 at 04:02:33PM +0100, Dave Mitchell wrote:
> $ perl5159 -e'@a = sort { goto FOO; FOO: $a <=> $b } 1,2,3'
> Can't "goto" out of a pseudo block at -e line 1.
> $
>
> I'd expect this this code to execute ok. Can anyone think of a reason why
> it isn't a bug?

Specifically that code that doesn't actually exit the block?

Yes, feels wrong that it doesn't work. goto is merely harmful, not fatal. :-)

Nicholas Clark


davem at iabyn

May 4, 2012, 8:24 AM

Post #3 of 3 (62 views)
Permalink
Re: unexpected: Can't "goto" out of a pseudo block [In reply to]

On Fri, May 04, 2012 at 04:10:07PM +0100, Nicholas Clark wrote:
> On Fri, May 04, 2012 at 04:02:33PM +0100, Dave Mitchell wrote:
> > $ perl5159 -e'@a = sort { goto FOO; FOO: $a <=> $b } 1,2,3'
> > Can't "goto" out of a pseudo block at -e line 1.
> > $
> >
> > I'd expect this this code to execute ok. Can anyone think of a reason why
> > it isn't a bug?
>
> Specifically that code that doesn't actually exit the block?

yes.

--
Please note that ash-trays are provided for the use of smokers,
whereas the floor is provided for the use of all patrons.
-- Bill Royston

Perl porters RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.