Do you count the fact that a loop starts two scopes, not one?
for (my $x = 0; $x < 10; ++$x) { # stuff my $y = $x; # more stuff }
Note that $x and $y are in different scopes. $y is local to the body of the loop. $x is global to the loop.

Also for some definition of scope, <package> starts a new scope.

And if we want the source differing, an if starts a scope and is different from either a block or a loop - try to do redo and it ignores the enclosing if for the enclosing block or loop.

I have also had occasion to run Perl code in a different process by opening a pipe to it, writing my code on the pipe, and then sending __END__. Does that count?

What about running code using reval from Safe? Does that count as different from eval?


In reply to Re: (Partial answers to) Barstool Trivia by tilly
in thread Barstool Trivia by dchetlin

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.