I get the same results. I'm using ActivePerl v5.6.1 on Win2k on a machine with little memory available. From the results below, I'm guessing you need less than 100MB free.

Hash 1 Rows/Sec: 62500.1 Hash 2 Rows/Sec: 4032.3

But the undef appears to be working nonetheless. I added a <STDIN> at the very top of the program, before the undef and at the very end of the program, and noted the size of perl's process using Task Manager before pressing Enter:

Start of execution: <2MB After one hash: 123MB After two hashes: 131MB

Update: On a machine with more memory:

ActivePerl v5.8.0, WinXP, 640MB available Hash 1 Rows/Sec: 250000.3 Hash 2 Rows/Sec: 250000.3 <2MB 154MB 157MB ActivePerl v5.6.1, WinXP, 640MB available Hash 1 Rows/Sec: 200000.2 Hash 2 Rows/Sec: 200000.2 <2MB 155MB 157MB

The slowdown is definitely related to virtual memory usage, but I don't know why it only affects the second pass.


In reply to Re: perl undef by ikegami
in thread Use of undef slowing down perl? by thalej

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.