If $sub_class_name comes in part or in whole from the user, be sure to validate it.
You should check if eval succeeds. It conveniently returns true or false in this case, so you can use the return value or $@ to check for errors.
You could also get rid of eval "" to speed things up (and decrease the chance of a security problem):
$class = "Class/${sub_class_name}.pm"; eval { require $class } or die("Error loading sub-class: $@$/");
In reply to Re: Run time require's and mod_perl
by ikegami
in thread Run time require's and mod_perl
by Mutant
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |