Hello. Some monks and I were discussing perl 6, and BooK said, why not just %elbow = 1..10, 11..20;
So I test it out, like i do everything, and i do: perl -e"%a=( 1..10, 11..20 );print keys %a" and I get no output.

I try all my activeperl installs, nada. I try all my indigoperl installs, same thing (btw this be 5.6.0 and 5.6.1 builds 618 and up)

Meanwhile, BooK says, yes it does, and spits Dumper in the cb: perl -MData::Dumper -e'print { 1..10, 11..20 } and sure enough, Dumper dumps a hash like:

$VAR1 = { '13' => 14, '7' => 8, '15' => 16, '9' => 10, '1' => 2, '17' => 18, '3' => 4, '19' => 20, '11' => 12, '5' => 6 };

So I ssh over to jcwrens machine and sure enough i get some keys (111313515717919).

So now I says to me, this must be a bug, and to confirm, i try: perl -MData::Dumper -e "%a= 1 .. 10, 2 .. 11 ;print Dumper \%a" which yields nada, and then perl -MData::Dumper -e "$a={ 1 .. 10, 11.. 20};print Dumper $a" which spits our (as expected)

$VAR1 = { '13' => 14, '7' => 8, '15' => 16, '9' => 10, '1' => 2, '17' => 18, '3' => 4, '19' => 20, '11' => 12, '5' => 6 };
So, I think this is a win32 bug. Can anyone confirm/deny? Anyone have any idea where it is, sourcecode wise? (like foo.c or something)

 
___crazyinsomniac_______________________________________
Disclaimer: Don't blame. It came from inside the void

perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"


In reply to perl -e hash assignment and range operator bug by crazyinsomniac

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.