Thats because your trying to goto a block that looks like it would be optimized out of existance. Since $data is a constant the optimizer components that look at switches are probably smart enough to notice that only the when (1) case will run and will replace the whole switch in the op tree with simply say 'one'; goto two;.
Disclaimer: I don't claim to have intimate knowledge of how switches are implemented in the optree or how the optimizer treats them. Take this explanation with a grain of salt, it may sound good, but it may also be flat out wrong.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|