> 7) It was suprise for me that when I used "$hash{length}" it interpreted (length $_) as "length";

I was shocked to read that, till ...

DB<24> $h{length}=3 => 3 DB<25> \%h => { length => 3 }

... I realized the behaviour is sane (autoquoting of barewords) and that you want it reversed to DWIM magic which is easily avoided with little explicit syntax.

just use parens if you really want to avoid an explicit $_

DB<33> $_="abc" => "abc" DB<34> $h{length()}=42 => 42 DB<35> \%h => { 3 => 42, length => 3 } DB<36> $_="abcd" => "abcd" DB<37> $h{(length)}=666 => 666 DB<38> \%h => { 3 => 42, 4 => 666, length => 3 }

In this contrived case ( length as a hashkey? ) I'd personally reject anything other than

DB<39> $h{length $_}= 'best' => "best" DB<40> \%h => { 3 => 42, 4 => "best", length => 3 }

in code review.

Question Are you possibly unconciously trolling???

Opinion I doubt that ... but keep on trying to entertain us.

Cheers Rolf

(addicted to the Perl Programming Language and ☆☆☆☆ :)


In reply to Re: Opinion: where Perl5 wasn't attractive for me by LanX
in thread Opinion: where Perl5 wasn't attractive for me by rsFalse

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.