fw() for 1 .. 10; sub fw { my %uniq; for my $ix ( 0 .. 100 ){ for my $key ( wf() ){ my $count = $uniq{$key}++; if( $count > 1 ){ my $keycount = keys %uniq; my $buckets = %uniq; print "started repeating at iteration $ix after only $ +keycount in $buckets buckets \n"; return; } } } } sub wf { my %f; $f{ [] } = [0]; $f{ [] } = [1]; $f{ [] } = [2]; $f{ [] } = [3]; return keys %f; } __END__ started repeating at iteration 8 after only 26 in 20/32 buckets started repeating at iteration 4 after only 14 in 13/32 buckets started repeating at iteration 5 after only 17 in 14/32 buckets started repeating at iteration 5 after only 17 in 13/32 buckets started repeating at iteration 5 after only 19 in 15/32 buckets started repeating at iteration 5 after only 18 in 16/32 buckets started repeating at iteration 6 after only 18 in 16/32 buckets started repeating at iteration 7 after only 20 in 15/32 buckets started repeating at iteration 6 after only 18 in 14/32 buckets started repeating at iteration 7 after only 26 in 21/32 buckets

In reply to Re^2: Allocation of anonymous arrays (ref addr repeats) by Anonymous Monk
in thread Allocation of anonymous arrays by OwlHoot

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.