...is the statement part of a conditional in the same block as the body itself?

No, the conditional is outside the block, both physically and logically (err...physiologically? ;-).

Your example is equivalent to:

my $el; while ($el = pop @els) { # Body of loop }

BTW, in Perl 6, if and while (and the rest of the control structures) can be thought of as built-in functions. As if they were:

sub while (BOOL $condition, &closure) {...} sub if (BOOL $condition, &closure) {...}

That's why the conditional is not part of the block: it's an entirely separate argument to the control structure.

And, yes, you'll be able to get the signature (a.k.a. prototype) of a control structure, and overload it, and redefine it (lexically).

And you'll probably be able to write bad things like:

if condition(), &call_me;

and worse things like:

&debug := { if BEGIN{$debug}, &^action }; # and later... debug { print "here" }

In reply to Re: Re: Perl 6 will make amends (was:Perl's Bad Ideas) by TheDamian
in thread Perl's Bad Ideas by japhy

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.