Greetings,

I am putting together a (in my opinion :-) very cool Perl application that stores website metadata in a database, and then dynamically generates HTML. Just the initial version has lots of useful features, and I plan on making it Open Source as soon as it is somewhat functional, but that isn't why I'm posting this. :-)

My problem is that I am pulling Perl subroutines out of the database, and after I eval about 20k of code eval seems to get full, and I get errors as though the code has been truncated. I know the code isn't truncated, so I'm pretty sure it is some wierd problem with eval. Here is the example code:

eval "sub " . $SubName . " {" . $SubBody . "}";

After checking here, I came accross http://www.perlmonks.org/index.pl?node_id=5430&lastnode_id=864 and tried the following code for first subroutine to be loaded that goes beyond this mysterious limit:

my $SubRef; my $Hack = "sub " . " {" . $Subroutine->[2] . "}"; eval "\$SubRef = $Hack"; undef &{ *VWP_GenQueryHTML{CODE} }; *VWP_GenQueryHTML = $SubRef;

Unfortunately this appears to suffer from the same problem.

Can somebody please help? It's frustrating to be so close to a useful project and get stymied like this.

Thanks,
James

Edit by mirod: added code tags


In reply to Odd eval Problem by nontrivial

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.