I did catch the first issue, see my reply to Ovid for the currently-working version (I'll update my top node eventually).

As to the second point, I think you might have mis-read the code. The else is paired with if (DBI::db->can($op)) -- I don't die when that is false. Basically, if I try TestModule->prepar by accident, the else block is run because a database handle can't 'prepar'. My test suite verifies this.

Tests:

is ($obj->heekify, undef, 'Autoloading a bad sub fails'); is ($obj->error, 'Cannot autoload heekify', 'Error set correctly');

And both pass under the code in the reply to Ovid I mentioned above (the first passes in the code you're referencing, but as you point out, the error wasn't set).

As for the last two points, that is useful information for optimization. However, under the current form of usage, the whole script that calls this module only takes 3s to run. I will keep those tips handy for later, if optimization becomes an issue. Thank you -- I always love thinking about stuff like that!

<-radiant.matrix->
A collection of thoughts and links from the minds of geeks
The Code that can be seen is not the true Code
"In any sufficiently large group of people, most are idiots" - Kaa's Law

In reply to Re^4: Using AUTOLOAD to create class methods by radiantmatrix
in thread Using AUTOLOAD to create class methods by radiantmatrix

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.