Yep, you're correct. Sometimes it's just an extra pair of eyes that helps. Thank you! I updated my node to reflect the solution.
| [reply] |
| [reply] [d/l] [select] |
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!
| [reply] [d/l] [select] |