<?xml version="1.0" encoding="windows-1252"?>
<node id="1013610" title="Re: How does 'goto LABEL' search for its label?" created="2013-01-16 11:26:10" updated="2013-01-16 11:26:10">
<type id="11">
note</type>
<author id="708738">
LanX</author>
<data>
<field name="doctext">
Do you have a clear definition for "construct"?&lt;P&gt;&lt;P&gt;

from [doc://perlglossary]&lt;P&gt;&lt;P&gt;

&lt;i&gt;&lt;c&gt;
construct
       As a noun, a piece of syntax made up of smaller pieces.
&lt;/c&gt;&lt;/i&gt;&lt;P&gt;&lt;P&gt;

I think in this context it's supposed to mean "block of a loop".&lt;P&gt;&lt;P&gt;

IMHO this discussion helps:   [id://833015]  &lt;P&gt;&lt;P&gt;

From what I remember labels are only visible from the actual "frame" and parent frames.&lt;P&gt;&lt;P&gt;

Frames are constructs which need an initialization like &lt;c&gt;sub&lt;/c&gt;s or &lt;c&gt;for-each&lt;/c&gt;-loops (remember the aliased loop-var!).&lt;P&gt;&lt;P&gt;

That means you &lt;u&gt;can't&lt;/u&gt; jump into these constructs and bypass initialization.&lt;P&gt;&lt;P&gt;

But if you call another sub from within such a frame, that means after run-time initialization, you can &lt;C&gt;goto&lt;/C&gt; back.&lt;P&gt;&lt;P&gt;

So lables are a run-time thing. They belong to the dynamic scope like localized vars.  &lt;P&gt;&lt;P&gt;

EDIT: I think the deprecation is supposed to disallow jumps into other kinds of loops like &lt;c&gt;while&lt;/c&gt;¹ or c-style &lt;c&gt;for&lt;/c&gt;s , which have a "logical" but no "physical" initialization like frames.&lt;P&gt;&lt;P&gt;

HTH!
&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-708738"&gt;
&lt;p&gt;Cheers Rolf
&lt;/div&gt;&lt;/div&gt;&lt;P&gt;&lt;P&gt;

¹) remember that naked blocks are internally just while-loops</field>
<field name="root_node">
1013574</field>
<field name="parent_node">
1013574</field>
</data>
</node>
