Thanks allot radiant.matrix, exactly what I was looking for! I was using eval differently (and obviously wrong for this situation (
eval { $plugin; }; and
eval { "$plugin;" };)), which should explain why it was failing(?)....
Now that I can actually run something, things can, again, move along.
I have one final question (which is brought up due to the code loading the files needed (dynamically)). When using a variable to call a function, is there anyway to varify that function exists before calling it (since the function would have been 'loaded' at the time its called)?
For example:
....load pm files here....
$PAGE = "test_function_a";
eval { &$PAGE; }; $@ and die( &nopageerror() );
$PAGE = "test_function_b";
eval { &$PAGE; }; $@ and die( &nopageerror() );
exit;
sub test_function_a { print "in test_function_a"; }
sub nopageerror { print "The function $PAGE is unknown"; }
This is just an example, and not accurate. In fact, nopageerror doesn't even execute, rather the script just terminates, no error when ran in the browser, however, I can produce an additional log (out side of Apache), that then states "Undefined subroutine &main::test_function_b". Again, the above is just an example to explain, with as little overhead/code as possible to better show the area I'm stuck in. Yes the sub function test_function_b is not present here, to intentionally cause an error situation.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.