Some time ago it occurred to me that in a map()'s BLOCK a no (or use, for what that matters) statement "doesn't work", e.g.:
my %hash=map { no strict 'refs'; $_ => \&{$_}; } qw/sol1 sol2 .../; # Pseudo-code
I had brought this on clpmisc, at map()'s BLOCK [was: "Re: Q: re Inline and Benchmark"] (also available from Google or from Google-beta) and there were fundamentally two kind of reactions, as you can see by yourself:
  1. in Perl there are already so many deviations from orthogonality, that this is not that surprising after all,
  2. deviations from orthogonality generally serve the purpose of implementing dwimmeries, but one can't see how this could apply to the one under consideration, so it simply "shouldn't" be there...
What do you monks think about this?

Note: I do know that there are tons of other ways around the issue, e.g. with a do block and the EXPR-form of map.


In reply to map()'s BLOCK and deviations from othogonality... by blazar

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.