...the thing doesn't have to be recursive

The issue is that while running your code, perl internally builds up a call stack of impressive depth (218255 frames here — my attempt segfaulted at $count being around 43650 (with the default ulimit -s setting of 8192kB)), as shown by the backtrace based on the core dump:

$ ./665040.pl Count, Last value: Testing: 43650 -> 43650 Segmentation fault (core dumped) $ gdb /usr/local/perl/5.10.0/bin/perl core (...) Core was generated by `/usr/local/perl/5.10.0/bin/perl ./665040.pl'. Program terminated with signal 11, Segmentation fault. #0 0x080acd57 in Perl_sv_clear () (gdb) bt #0 0x080acd57 in Perl_sv_clear () #1 0x080ad378 in Perl_sv_free2 () #2 0x0809915f in Perl_av_undef () #3 0x080ad129 in Perl_sv_clear () #4 0x080ad378 in Perl_sv_free2 () #5 0x080acd5f in Perl_sv_clear () #6 0x080ad378 in Perl_sv_free2 () (...) (...) #218242 0x0809915f in Perl_av_undef () #218243 0x080ad129 in Perl_sv_clear () #218244 0x080ad378 in Perl_sv_free2 () #218245 0x080acd5f in Perl_sv_clear () #218246 0x080ad378 in Perl_sv_free2 () #218247 0x0809915f in Perl_av_undef () #218248 0x080ad129 in Perl_sv_clear () #218249 0x080ad378 in Perl_sv_free2 () #218250 0x080c79e0 in Perl_leave_scope () #218251 0x080a13a8 in Perl_pp_unstack () #218252 0x080a0bb8 in Perl_runops_standard () #218253 0x0809f652 in perl_run () #218254 0x0805ee8f in main () (gdb)

In reply to Re^2: Oddity with memory manglement in 5.8.8, 5.10.0 by almut
in thread Oddity with memory manglement in 5.8.8, 5.10.0 by lembark

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.