Here is the simplest example of what I'm playing with.

#!/usr/bin/perl use strict; my $DOWARN = 0; BEGIN { $SIG{'__WARN__'} = sub { warn $_[0] if $DOWARN } } my $symbol_list = "symbolsV1p1.dat"; my @symbol_pool = (); my $symbol_size = 0; my $index = 0; my $seed = "while "; my $embryo = $seed; my $MAX_ITER = 10; my $i = 0; my $result = undef; print "test.pl started...\n"; # Open my file list of symbols and functions # I will randomly jumble around and eval. open(SYMBOLS, "<$symbol_list") or die "Could not open $symbol_list: $! +\n"; while (<SYMBOLS>) { chomp $_; print "symbol_pool character is: $_\n"; push(@symbol_pool, $_); } close(SYMBOLS); $index = int(rand($symbol_size)); print "Initial embryo is:\n$embryo\n"; while (1) { $embryo = $embryo . $symbol_pool[$index] . ";"; $result = eval($embryo); # Print out the successful string eval's if ($result != undef) { print "\n\nA working one liner has been generated!\n"; print "$embryo\n"; print "Line: $i\n\n"; $i++; } # Truncate the string to keep it from growing infinitely long if (length($embryo) >= 80) { $embryo = $seed; } # Stop the script after I get a few successful string eval's if ($i == $MAX_ITER) { print "Program finished\n"; exit(0); } $index = int(rand($symbol_size)); }

In reply to Re^2: Perl 5.10 eval($string) memory leak by fuzzmonkey
in thread Perl 5.10 eval($string) memory leak by fuzzmonkey

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.