in reply to Re^2: Label makes a sub to return empty list -- "secret"? documented?
in thread Label makes a sub to return empty list -- "secret"? documented?

> Otoh, now I have a justification (not that I need any or anyone cares) not to follow PBP's "Place the label on the line preceding the loop keyword" --

That's a weird logical construct

There was no indication or benchmark in this thread so far that placing a label at a previous line comes with a notable performance overhead.

Cheers Rolf
(addicted to the Perl Programming Language :)
see Wikisyntax for the Monastery

  • Comment on Re^3: Label makes a sub to return empty list -- "secret"? documented?

Replies are listed 'Best First'.
Re^4: Label makes a sub to return empty list -- "secret"? documented?
by Anonymous Monk on Sep 14, 2025 at 18:44 UTC

    It's not performance this time. Intuitively, labels belong to the same "subordinate" "category" as e.g. semicolons, both not far from comments and white-space. Extra semicolon at the end of a block doesn't change what this block evaluates to. Lone label, I now know, does, which is dangerous. Neglected to have been (temporarily?) commented-out along with its loop (if placed per PBP at the next line) and maybe some further statements. Of course, it's the same weird nonsense, please ignore.

      OK I see your point now, but it's a bit contrived to have expectations about the new return value after commenting a trailing loop out.

      (IIRC is the return value of a loop not defined.)

      Anyway thanks for the discussion, I learned something new. :)

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      see Wikisyntax for the Monastery