I don't know why you are being so hostile, but I see little point in continuing.

Yes, I had a thinko and switched A and B once. BFD. As for the rest run the following code and observe the scoping carefully:

for (my $foo) { $_ = "In scope"; print "Inside: $foo\n"; } print "Outside: $foo\n";
If you can get Perl 5.003 and run the same code. Note the differences.

This change is no larger than it would be to see the inline for loop scoped exactly like a regular for loop. That change would ruin merlyn's snippet. Therefore, knowing about this past change, I raised my concern over whether this specific scoping detail was likely to be safe across releases of Perl. merlyn said point blank that it was a risk, but thought it didn't matter much since so much will change in Perl 6.

I don't think I have any more to say on this topic. You wanted to know why I asked the question. You have your answer. No matter how stupid you think the question was, both merlyn and danger gave me reason to think that it was not unreasonable...


In reply to Re (tilly) 7: Declaring and initializing a hash with a list of keys and a list of values by tilly
in thread Declaring and initializing a hash with a list of keys and a list of values by merlyn

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.