Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re^2: How does 'goto LABEL' search for its label? (do-blocks)

by LanX (Chancellor)
on Jan 17, 2013 at 18:50 UTC ( #1013854=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    > perl -MO=Deparse -E'if (1) { label: say 1;}; goto label'
    BEGIN {
        label: say 1
    goto label;
  2. or download this
    perl -wE'do { label: say 1;}; goto label'
  3. or download this
    perl -wE'my $x=0;do { label: say $x++; die if $x>1}; goto label'
    Died at -e line 1.
  4. or download this
    [davido]: LanX: perl -E 'goto IN; do{ IN: say "Hello world\n";};' does
    + produce the warning on 5.16.2.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1013854]
[Corion]: GotToBTru: Yeah, I started a quick(ly implemented but slowly running) implementation of a program that would guess the "best" configuration (that is, least amount of changes) from my code, but then found that it stops parsing the source as soon as it ..
[GotToBTru]: sadly, it can't do anything about this
[Corion]: ... encounters sub foo($bar,$baz) {, which is something I like nowadays
[Corion]: GotToBTru: Yeah, that stuff is hard to do away automatically ;)
[GotToBTru]: yeah, you mentioned it could not handle signatures
[Corion]: And so far I like signatures and nobody has yet come up to me and screamed at me for implementing a source filter to handle them even on early Perl versions ;)
[Corion]: I should re-prod tsee about the Filter::Simple branches that he might want to merge or that I should merge so he can do a release ;-D

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (15)
As of 2017-02-27 14:38 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (387 votes). Check out past polls.