Egads.

Although I haven't looked inside Test::More, I think I see what you're talking about. I tried this:

#!/usr/bin/perl use warnings; use strict; sub tear_us_outta_here { print "Getting out of loop labeled FOO.\n"; last FOO; } FOO: for ( 1 .. 10 ) { print "At $_.\n"; if ( $_ == 4 ) { tear_us_outta_here(); } }
~~~ yields ~~~
At 1. At 2. At 3. At 4. Getting out of loop labeled FOO. Exiting subroutine via last at ./foo.pl line 8.
That looks kinda' weird and scary to me... :)

Heh,.. for this sort of stuff, we should have a Halloween Perl-ghost-story-hour every October:

{dark room with flashlight shining up on an upright dead-tree printout of some code}:
"On this very line of code, many iterations ago, for no apparent reason, the loop... abruptly ended! Some say it was a hardware failure, others suggest deep magic at work in the bowels of the interpreter..."
;)

EDIT: Thanks for all the replies and interesting suggestions folks. Seems like, as Ovid suggests, the original author of the code I'm looking at just used the labels as some off form of odd commenting -- especially considering that there isn't any pod in the code.


In reply to Re^2: What's the point of a labeled block without a loop? by JohnMG
in thread What's the point of a labeled block without a loop? by JohnMG

Title:
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, details, 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, summary, 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.