Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

I sympathized with the "yow" remark because it looked like the difference between finding the label and not finding the label was whether "return" was used. But that was a red herring.

The real difference is whether the one-liner ends with "G" or with "F". The inclusion of the 'return' keyword makes no difference (but lacking the 'return' when calling "F" makes the reason for the output less obvious).

Once I noticed the single-character difference off at the end of the long lines, then I lost sympathy for a "yow" response because the behavior is exactly as I would have expected from the documentation. And, it seems a reasonable restriction.

Now, I think using 'goto' to leave a subroutine is a rather squirrely technique. I would much prefer that it produced a warning so you'd have to write such squirrely code more like:

sub F { return G(); LF: say 6; } sub G { say 2; no warnings 'exiting'; goto LF; } G();

Indeed, I'm not sure why the -w you used fails to trigger this:

=item Exiting subroutine via %s (W exiting) You are exiting a subroutine by unconventional means, such as a goto, or a loop control statement.

- tye        

In reply to Re^3: How does 'goto LABEL' search for its label? (yow?) by tye
in thread How does 'goto LABEL' search for its label? by moritz

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others drinking their drinks and smoking their pipes about the Monastery: (4)
    As of 2015-11-28 19:04 GMT
    Find Nodes?
      Voting Booth?

      What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

      Results (743 votes), past polls