Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Using eval to create 'plugins'by r.joseph (Hermit) |
on Jan 09, 2001 at 13:06 UTC ( [id://50640]=perlquestion: print w/replies, xml ) | Need Help?? |
r.joseph has asked for the wisdom of the Perl Monks concerning the following question:
I have a large CGI system that my company uses that I developed for generating dynamic webpages. This system is large and has been developed by me over a few years. The website that it runs on will soon be webmastered by a perl novice who does not want to mess with my system. Here is my question: the script I wrote is run everytime a request is sent for this particular domain. To allow this new webmaster to add functionality to the system without having to edit the main file, I wanted to allow him to write special files (with a certain extension or some identifier) that are just perl files that the system would search for upon every execution, and if it found them, execute. I was thinking about just slurping the whole 'plugin' file and then eval-ing it. Now, as long as he knows what he is doing and writes conservative and clean code, and as long as I come up with some way of making sure that the file is written by him and not by someone else (some kind of passcode or something - that is not important), is it safe to do what I am planning, ie: using eval to execute whole files like this? It seems like it should work as long as I make sure to watch @! and what have you, but I just wanted to ask the best perlites I know what they thought. Thanks a bunch for your help!! R.Joseph
Back to
Seekers of Perl Wisdom
|
|