OK I'm totally lost at this point. I tried scaling back, and using browser passed variabls to call functions. Regretfully I can't even get that far because I'm simply not understanding why the following fails to work:
for $plugin (<Main/*.pm>) {
$plugin =~ s!/!::!g;
$plugin =~ s/\.pm$//;
use $plugin;
}
What in the world am I doing wrong here? When this executes I get this error in the Apache error.log (and Error 500 in the Browser):
...syntax error at .... near "use $plugin"
Changing the code to:
for $plugin (<Main/*.pm>) {
$plugin =~ s!/!::!g;
$plugin =~ s/\.pm$//;
$plugin = "use $plugin\;";
$plugin;
}
Results in no error message in the browser, however, Errors in the Apache errors.log about missing and/or unknown function calls (Undefined subroutine), which would be in the included (
use'd) .pm files...
I also attempted to use
require and
eval, which resulted Undefined subroutine messeges appearing in the Apache error.log. How can you simply
use a complete directory of .pm files, without packageing anything or calling specific subs in the includes (blind including of files in location X), ignoring all potential hazards of doing something like this, just
use filename; in a for loop and continue processing, and have the functions in the
use'd files available outside the specific loop that
use'd them?
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.